Struct loggerv::Logger [] [src]

pub struct Logger { /* fields omitted */ }

Methods

impl Logger
[src]

[src]

Creates a new instance of the verbosity-based logger.

The default level is WARN. Color is enabled if the parent application or library is running from a terminal, i.e. running a tty. The default separator is the ": " string. The default output format is module path: message. The following default colors are used:

Level Color
Error Bright Red
Warn Bright Yellow
Info Bright Green
Debug Light Grey
Trace Grey

[src]

Sets the output color for the ERROR level. The default is bright red.

[src]

Sets the output color for the WARN level. The default is bright yellow.

[src]

Sets the output color for the INFO level. The default is bright green.

[src]

Sets the output color for the DEBUG level. The default is light grey.

[src]

Sets the output color for the TRACE level. The default is grey.

[src]

Sets the separator string.

The separator is the string between the "tag" and the message that make up a log statement. The tag will be colorized if enabled, while the message will not. The default is :.

If the level, line numbers, and module path are all not included in the log statement, then the separator is changed to the empty string to avoid printing a lone string or character before each message portion of the log statement.

[src]

Enables or disables colorizing the output.

If the logger is not used in a terminal, then the output is not colorized regardless of this value.

[src]

Disables colorizing the output.

The default is to colorize the output unless stdout and stderr are redirected or piped, i.e. not a tty.

[src]

Enables or disables including line numbers in the "tag" portion of the log statement. The tag is the text to the left of the separator.

[src]

Enables or disables including the level in the log statement's tag portion. The tag of the log statement is the text to the left of the separator.

If the level and the module path are both inculded, then the module path is surrounded by square brackets.

[src]

Explicitly sets the log level instead of through a verbosity.

[src]

Enables or disables including the module path in the "tag" portion of the log statement.

The tag is the text to the left of the separator. The default is to include the module path. Ifthe level is also included, the module path is surrounded by square brackets.

[src]

Disables the module path in the "tag" portion of the log statement.

The tag is the text to the left of the separator. The default is to include the module path.

[src]

Converts the verbosity to a log level.

A verbosity of zero (0) is the default, which means ERROR and WARN log statements are printed to stderr. No other log statements are printed on any of the standard streams (stdout or stderr). As the verbosity is increased, the log level is increased and more log statements will be printed to stdout. A verbosity of 1 will print INFO log statements to stdout in addition to ERROR and WARN. A verbosity of 2 will print INFO and DEBUG log statements to stdout. A verbosity of 3 or higher will print INFO, DEBUG, and TRACE log statements to stdout with ERROR and WARN statements printed to stderr.

[src]

Initializes the logger.

This also consumes the logger. It cannot be further modified after initialization.

If the tag will be empty because the level, line numbers, and module path were all disabled, then the separator is changed to the empty string to avoid writing a long character in front of each message for each log statement.

Trait Implementations

impl Debug for Logger
[src]

[src]

Formats the value using the given formatter.

impl Clone for Logger
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for Logger
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Log for Logger
[src]

[src]

Determines if a log message with the specified metadata would be logged. Read more

[src]

Logs the LogRecord. Read more

impl Default for Logger
[src]

[src]

Returns the "default value" for a type. Read more