ignoreLogs config not honored and hugo build is failing

I am trying to log some messages in my layout files for troubleshooting using fmt.Erroridf like so:

{{ fmt.Erroridf "DBG" "sdfsfsf ssafdsa" }}

… and I have added this in config.yml:

ignoreLogs: [ "DBG", ... ]

But hugo command still fails with the following error:

Start building sites …
hugo v0.127.0+extended darwin/arm64 BuildDate=2024-06-05T10:27:59Z VendorInfo=brew

ERROR sdfsfsf
You can suppress this error by adding the following to your site configuration:
ignoreLogs = ['DBG']
Total in 213 ms
Error: error building site: logged 1 error(s)

Is there anything else I am missing?

Seems like there’s a casing bug in that setup, if you use all lower case ids it works (dbg).

1 Like

Oops … tricky bug! Thanks for raising an issue.

I changed to dbg and it works. Not quite though. Now, the build passes but I don’t see the message logged to the console, which beats the purpose. I would like to see the message (for troubleshooting) in the console and not fail the build. Is such a thing supported?

Use warnf or warnidf.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.