mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'
This commit is contained in:
@@ -1,14 +1,8 @@
|
||||
---
|
||||
title: Logging
|
||||
description: Enable logging to inspect events while building your site.
|
||||
categories: [troubleshooting]
|
||||
categories: []
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: troubleshooting
|
||||
weight: 30
|
||||
weight: 30
|
||||
toc: true
|
||||
---
|
||||
|
||||
## Command line
|
||||
@@ -20,40 +14,39 @@ Hugo has four logging levels:
|
||||
error
|
||||
: Display error messages only.
|
||||
|
||||
```sh
|
||||
hugo --logLevel error
|
||||
```
|
||||
```sh
|
||||
hugo --logLevel error
|
||||
```
|
||||
|
||||
warn
|
||||
: Display warning and error messages.
|
||||
|
||||
```sh
|
||||
hugo --logLevel warn
|
||||
```
|
||||
```sh
|
||||
hugo --logLevel warn
|
||||
```
|
||||
|
||||
info
|
||||
: Display information, warning, and error messages.
|
||||
|
||||
```sh
|
||||
hugo --logLevel info
|
||||
```
|
||||
```sh
|
||||
hugo --logLevel info
|
||||
```
|
||||
|
||||
debug
|
||||
: Display debug, information, warning, and error messages.
|
||||
|
||||
```sh
|
||||
hugo --logLevel debug
|
||||
```
|
||||
```sh
|
||||
hugo --logLevel debug
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
If you do not specify a logging level with the `--logLevel` flag, warnings and errors are always displayed.
|
||||
{{% /note %}}
|
||||
> [!note]
|
||||
> If you do not specify a logging level with the `--logLevel` flag, warnings and errors are always displayed.
|
||||
|
||||
## 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.
|
||||
|
||||
{{< list-pages-in-section path=/functions/fmt filter=functions_fmt_logging filterType=include >}}
|
||||
{{% list-pages-in-section path=/functions/fmt filter=functions_fmt_logging filterType=include %}}
|
||||
|
||||
## LiveReload
|
||||
|
||||
|
Reference in New Issue
Block a user