Coder Social home page Coder Social logo

brutella-log's Introduction

Log

This library replaces the standard log package to get optional logging behavior based on simple rules. It provides variables to dis-/enable logging for predefined prefixes.

Example

import "github.com/brutella/log"

// Disable verbose logging
log.Verbose = false
log.Println("[VERB] Cleanup...") // no output

// Disable error logging
log.Info = false
log.Println("[INFO] Cleanup failed") // no output

// Disable error logging
log.Warn = false
log.Println("[WARN] Problem ahead") // no output
    
// Disable error logging
log.Error = false
log.Println("[ERRO] Serious problem") // no output

No code changes required

Because the library provides the same logging methods as the standard log package, you just have to change the import path from import "log" to import "github.com/brutella/log".

Contact

Matthias Hochgatterer

Github: https://github.com/brutella/

Twitter: https://twitter.com/brutella

License

log is available under the MIT license. See the LICENSE file for more info.

brutella-log's People

Contributors

brutella avatar

Watchers

Ivan Vučica avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.