Skip to content

deavmi/gogga

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Simple VT100 colourised pretty-printing logger




D

Usage

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.

Quick-and-dirty logging functions

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:

  1. DEBUG(...)
  2. INFO(...)
  3. WARN(...)
  4. 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.

About

Plug-and-play colorful VT100 logging for your terminal

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages