Skip to content

Commit

Permalink
Improve expository nature of my waffle about log levels
Browse files Browse the repository at this point in the history
  • Loading branch information
gwynforthewyn committed Aug 22, 2024
1 parent 7349464 commit a61c5a0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
<section id="introduction">
<p>
The examples in the <a href="https://pkg.go.dev/log/slog">slog docs</a> are pretty convoluted. Setting a log level via an environment variable's actually
pretty simple. Here's the code. Note the function at the bottom called `getLogLevelFromEnv()` and that it's called in the HandlerOptions:
pretty simple. Here's the code. By default the code is silent, set <code>LOG_LEVEL</code> in your environment to one of the strings "INFO", "DEBUG", "WARN" or "ERROR"
to enable that level of logging.
</p>
<p>
Note the function at the bottom called `getLogLevelFromEnv()` and that it's called in the HandlerOptions:
</p>
</section>

Expand Down

0 comments on commit a61c5a0

Please sign in to comment.