The log dial: how much the engine's own trove/log! calls print, as a value a
running process can change.
Verbosity is otherwise decided before a process starts, and the process that most
needs a different setting is the one nobody can restart — a daemon a week into a run,
on a :disk KB that pays recover on the way back up. So the level is an atom,
read per call by the one backend installed here; turning the dial is a reset! and
never a second install, and two dials wrapped around each other is a state this cannot
reach.
vaelii.core/set-log-level and VAELII_LOG_LEVEL install a backend. Nothing else
does: opening a KB does not, and neither does loading this namespace with the variable
unset. A library that replaces taoensso.trove/*log-fn* because it was loaded
takes over the logging of the application that loaded it — a worse failure than a
quiet engine, since the host loses its own lines and has nothing left to correlate.
The variable is read at load, which is also the ordering that keeps it true: a host
installing its own backend does so after requiring the engine, and wins.
The sink is Trove's console backend and the ranking below is the whole of what this
puts in front of it. The ranking covers Trove's seven levels rather than the five the
dial takes, so a message at :fatal or :report sorts above :error and prints
under every setting instead of falling to a rank of zero and being suppressed by all
of them.
The log dial: how much the engine's own `trove/log!` calls print, as a value a *running* process can change. Verbosity is otherwise decided before a process starts, and the process that most needs a different setting is the one nobody can restart — a daemon a week into a run, on a `:disk` KB that pays `recover` on the way back up. So the level is an **atom**, read per call by the one backend installed here; turning the dial is a `reset!` and never a second install, and two dials wrapped around each other is a state this cannot reach. ## The engine installs nothing unasked `vaelii.core/set-log-level` and `VAELII_LOG_LEVEL` install a backend. Nothing else does: opening a KB does not, and neither does loading this namespace with the variable unset. A library that replaces `taoensso.trove/*log-fn*` because it was *loaded* takes over the logging of the application that loaded it — a worse failure than a quiet engine, since the host loses its own lines and has nothing left to correlate. The variable is read at load, which is also the ordering that keeps it true: a host installing its own backend does so after requiring the engine, and wins. ## A level check, not a backend The sink is Trove's console backend and the ranking below is the whole of what this puts in front of it. The ranking covers Trove's seven levels rather than the five the dial takes, so a message at `:fatal` or `:report` sorts above `:error` and prints under every setting instead of falling to a rank of zero and being suppressed by all of them.
(current-level)The level the dial holds, or nil when the engine has installed no backend. Nil says
the level is whatever taoensso.trove/*log-fn* already was — Trove's own console
backend at :info, unless the host application installed one of its own.
The level the dial holds, or nil when the engine has installed no backend. Nil says the level is whatever `taoensso.trove/*log-fn*` already was — Trove's own console backend at `:info`, unless the host application installed one of its own.
What the dial takes, quietest first. Five of Trove's seven: :fatal and :report
rank above everything the engine emits, so setting the floor there is asking for
silence with extra steps, and the two are honoured as message levels either way.
What the dial takes, quietest first. Five of Trove's seven: `:fatal` and `:report` rank above everything the engine emits, so setting the floor there is asking for silence with extra steps, and the two are honoured as *message* levels either way.
(enabled? level)Is a message at level at or above the dial? The level check, read per call, so the
dial is one reset! rather than a reinstalled backend per change.
With the dial unset every level is enabled, which is a reading the installed backend never sees: nothing is installed until the dial holds a level.
Is a message at `level` at or above the dial? The level check, read per call, so the dial is one `reset!` rather than a reinstalled backend per change. With the dial unset every level is enabled, which is a reading the installed backend never sees: nothing is installed until the dial holds a level.
Trove's levels, ranked. A level this map does not name — nil, or a typo in a log!
— sorts at the bottom with :trace and therefore prints: a message the dial cannot
rank is one the operator should see, not one it silently drops.
Trove's levels, ranked. A level this map does not name — nil, or a typo in a `log!` — sorts at the bottom with `:trace` and therefore *prints*: a message the dial cannot rank is one the operator should see, not one it silently drops.
(set-level level)Set the dial to level and install the console backend at the root of
taoensso.trove/*log-fn*, returning the level. vaelii.core/set-log-level is the
public spelling.
A level outside dial-levels is refused by name (:type :unknown-option) rather
than defaulted: a dial that reads :verbose as :info is one an operator turns and
believes, and the failure mode worth refusing is the one that leaves a process
silent.
Set the dial to `level` and install the console backend at the root of `taoensso.trove/*log-fn*`, returning the level. `vaelii.core/set-log-level` is the public spelling. A level outside `dial-levels` is **refused by name** (`:type :unknown-option`) rather than defaulted: a dial that reads `:verbose` as `:info` is one an operator turns and believes, and the failure mode worth refusing is the one that leaves a process silent.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |