-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DOC] update channel and output part #53
Comments
@Messj1 Wow another great issue! Thanks! You really invested time in this. That is so great. Thank you. May I ask have you ever contributed to an Open Source project before? Would you like to give it a shot? |
@Download What do you think about a mini tutorial with the high_order channel mods i wrote as an example:
|
@Messj1 Yes that's also an option. |
Hi
I used
ulog
in a AMD environment with an high order channel which override the output channel if confighighorder_log
level get reached.ulog
is a really nice project for such extending stuff. 💪Would be nice to have some hints in the documentation. So i rewrote the channel an output part cause the channel configuration is part of channel and not the output. Output doesn't get configured at all 😉
Hope this helps.
Channels
In
ulog
, logging is always "sent" to exactly one channel. The channel get selected by the configuration. It can also be selected by extendingulog
with a mod. (see Custom channel selection )A channel has one or more configurable outputs that can optionally apply formatting to the message.
By default, two channels exist:
output
, for messages of loggers that are in debug mode, or that are at an enabled leveldrain
, for those messages that are filtered away.Channel selection
By having a separate channel for the drain, there is the opportunity to use another output than noop(link). So you can configure where discarded messages are going.
For example: send all logging records to a database and filter it later, when it get display for example (see output)
By default all log methods on a logger are associated with one of two channels,
output
anddrain
. When the logger is created, each log method is sent either to the output channel, or to the drain channel, based on the current log level for that logger and whether that logger is in debug mode.To configure the
drain
/output
channel selection the followinglog
config can be used:Custom channel selection
If the default behavior is not enough the channel selection in
ulog
can easily be extended like followed:Output configuration
The channel output, where messages are going, is completely configurable at runtime.
To configure the outputs for a channel, use the log_ config option. The default channels config options are:
log_output
, defaults toconsole
log_drain
, defaults tonoop
To configure the output for a channel, we assign the name of the output to use to the relevant loggers:
This setting can include expressions to target individual loggers, just like the debug and log settings:
The value part is actually a kurly format string. The same syntax can be used here as for configuring formatting.
If more than one output is specified, a multiplex function will be inserted that dispatches the logging to all specified outputs.
Syntax:
Hint: The first match get used. Except the default logger_name (*)
Outputs
Outputs are used in channels to peform the actual task and "log" the data.
By default, the following outputs are included:
Output
console
...
Output
noop
...
The text was updated successfully, but these errors were encountered: