colorlog

Public Imports

my.term_color
public import my.term_color;

Members

Classes

DebugLogger
class DebugLogger

Logger focused on debugging a program with colorization of the severity.

SimpleLogger
class SimpleLogger

Default logger with low clutter in the console which mean it is suitable for use with user interfacing log messages.

UnknownLogger
class UnknownLogger

Unknown logger.

Enums

SpanMode
enum SpanMode
Undocumented in source.
VerboseMode
enum VerboseMode

The verbosity level of the logging to use.

Functions

clearAllLoggers
void clearAllLoggers()

Remove all registered loggers.

confLogger
void confLogger(VerboseMode mode)

Configure std.experimental.logger sharedLog with a colorlog instance and register it with name "_".

getRegisteredLoggers
string[] getRegisteredLoggers()
log
logger.Logger log()

Log a mesage to the specified logger.

logSlow
logger.Logger logSlow()

Always takes the global lock to find the logger.

make
void make(logger.LogLevel lvl, string name)

Create a logger for the module and make it configurable from "outside" via the registry.

mixinModuleLogger
string mixinModuleLogger(logger.LogLevel defaultLogLvl)

A string mixin to create a SimpleLogger for the module.

parseLogNames
NameLevel[] parseLogNames(string arg, logger.LogLevel defaultLogLvl)

Parse a comma+equal separated string for logger names that can be used with setLogLevel.

register
void register(logger.Logger logger, string name)

Register a logger for the module and make it configurable from "outside" via the registry.

setLogLevel
void setLogLevel(string name, logger.LogLevel lvl, SpanMode span)

Set the log level for name.

setLogLevel
void setLogLevel(string[] names, logger.LogLevel lvl, SpanMode span)

Set the log level for all loggers in names.

setLogLevel
void setLogLevel(NameLevel[] names, SpanMode span)

Set the log level for all loggers in names.

toLogLevel
LogLevel toLogLevel(VerboseMode mode)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

NameLevel
struct NameLevel
Undocumented in source.

Variables

RootLogger
auto RootLogger;

The parent of all loggers.

Meta

Authors

Joakim Brännström (joakim.brannstrom@gmx.com)

Handles console logging in pretty colors.

The module disables colors when stdout and stderr isn't a TTY that support colors. This is to avoid ASCII escape sequences in piped output.

The loggers use strings (their name) to form a hierarchy. Such that "a" is the root and "a.b" is a child of "a". This can be used by you to change the log level of a "sub tree" (SpanMode.depth).