mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-13 07:04:59 -04:00
parent
3587d2998b
commit
f4460fd540
@ -14,14 +14,14 @@ workson: []
|
|||||||
hugoversion:
|
hugoversion:
|
||||||
relatedfuncs: [printf]
|
relatedfuncs: [printf]
|
||||||
deprecated: false
|
deprecated: false
|
||||||
aliases: []
|
aliases: [/functions/errorf]
|
||||||
---
|
---
|
||||||
|
|
||||||
`errorf` or `warnf` will evaluate a format string, then output the result to the ERROR or WARNING log (and only once per error message to avoid flooding the log).
|
`errorf` or `warnf` will evaluate a format string, then output the result to the ERROR or WARNING log (and only once per error message to avoid flooding the log).
|
||||||
|
|
||||||
Any ERROR will also cause the build to fail (the `hugo` command will `exit -1`).
|
Any ERROR will also cause the build to fail (the `hugo` command will `exit -1`).
|
||||||
|
|
||||||
Note that the WARNING will only be printed to the console.
|
Both functions return an empty string, so the messages are only printed to the console.
|
||||||
|
|
||||||
```
|
```
|
||||||
{{ errorf "Failed to handle page %q" .Path }}
|
{{ errorf "Failed to handle page %q" .Path }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user