8000 GitHub - MarconiProtocol/log
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

MarconiProtocol/log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marconi Logger

Overview

Marconi Logger is an application-wide logger and is expected to handle all the logging needs of an application including:

  • logging to multiple files
  • logging to console
  • filtering based on log level

Marconi Logger contains a list of individual log instances, where each one can have its own configurations. Underneath the hood, each log instance is a wrapper around the popular library "logrus".

Example Usage

// initialize logger
func initLogger() {
  mlog.Init("SOME_PATH", "info")
  
  // write to default log
  mlog.GetLogger().Debug("Hello World")
  mlog.GetLogger().Info("Hello World")
  
  // write to file
  logger, _ = mlog.GetLogInstance("FILE_NAME")
  logger.Debug("Hello World")
  logger.Info("Hello World")
}

How to Test

go test

More info on Logrus

https://github.com/sirupsen/logrus

Future Work

More improvements are expected:

  • log rotation
  • setting logging level at file level

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0