The API is rather straight-forward, simply create a new logger and then you can use it as such:
import gogga;
GoggaLogger gLogger = new GoggaLogger();
gLogger.info("This is an info message");
gLogger.warn("This is a warning message");
gLogger.error("This is an error message");
This should output something like the following:
Various styles are supported which can be set using mode(GoggaMode)
.
Or you can also View the full API.
For quick-and-dirty ease of use there is also a module called gogga.mixins
. Once
this module is imported it will mixin a set of variadic-argument functions for you
of the form:
DEBUG(...)
INFO(...)
WARN(...)
ERROR(...)
These will become immediately available to you and a logger that is configured to
write out to standard output will be configured with the styling of GoggaMode.SIMPLE
and a logging level of Level.INFO
.
As for build options there are the following available for configuration:
Build option name | Description |
---|---|
DBG_VERBOSE_LOGGING |
When enabled the GoggaMode.RUSTACEAN will be used |
DBG_DEBUG_LOGGING |
When enabled the logging level will be set to Level.DEBUG |
The GoggaLogger
logger instance created is shared amongst the same thread or
in other words it is stored as part of thread-local storage (TLS). For more information
browse the source code of source/gogga/mixins.d
.