Logging
Command line
Enable console logging with the --logLevel
command line flag.
Hugo has four logging levels:
- error
- Display error messages only.
hugo --logLevel error
- warn
- Display warning and error messages.
hugo --logLevel warn
- info
- Display information, warning, and error messages.
hugo --logLevel info
- debug
- Display debug, information, warning, and error messages.
hugo --logLevel debug
Template functions
You can also use template functions to print warnings or errors to the console. These functions are typically used to report data validation errors, missing files, etc.
- fmt.Errorf
- Log an ERROR from a template.
- fmt.Erroridf
- Log a suppressible ERROR from a template.
- fmt.Warnf
- Log a WARNING from a template.
- fmt.Warnidf
- Log a suppressible WARNING from a template.