Socket
Socket
Sign inDemoInstall

github.com/alecthomas/log4go

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/alecthomas/log4go

Package log4go provides level-based and highly configurable logging. This is inspired by the logging functionality in Java. Essentially, you create a Logger object and create output filters for it. You can send whatever you want to the Logger, and it will filter that based on your settings and send it to the outputs. This way, you can put as much debug code in your program as you want, and when you're done you can filter out the mundane messages so only the important ones show up. Utility functions are provided to make life easier. Here is some example code to get started: log := log4go.NewLogger() log.AddFilter("stdout", log4go.DEBUG, log4go.NewConsoleLogWriter()) log.AddFilter("log", log4go.FINE, log4go.NewFileLogWriter("example.log", true)) log.Info("The time is now: %s", time.LocalTime().Format("15:04:05 MST 2006/01/02")) The first two lines can be combined with the utility NewDefaultLogger: log := log4go.NewDefaultLogger(log4go.DEBUG) log.AddFilter("log", log4go.FINE, log4go.NewFileLogWriter("example.log", true)) log.Info("The time is now: %s", time.LocalTime().Format("15:04:05 MST 2006/01/02")) Usage notes: Changes from 2.0: Future work: (please let me know if you think I should work on any of these particularly)


Version published

Readme

Source

This is an unmaintained fork, left only so it doesn't break imports.

Please see http://log4go.googlecode.com/

Installation:

  • Run goinstall log4go.googlecode.com/hg

Usage:

  • Add the following import: import l4g "log4go.googlecode.com/hg"

Acknowledgements:

  • pomack For providing awesome patches to bring log4go up to the latest Go spec

FAQs

Last updated on 09 Jan 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc