GithubHelp home page GithubHelp logo

binalyze / logger Goto Github PK

View Code? Open in Web Editor NEW
28.0 3.0 1.0 6 KB

Binalyze logger is an easily customizable wrapper for logrus with log rotation

Go 100.00%
golang golang-package golang-library logging log logger logrus

logger's Introduction

logger

logger is an easily customizable wrapper for logrus with log rotation

Usage

There is only one function to initialize logger.

logger.Init()

When the logger package is initialized with logger.Init, user can log with the helper functions below.

// Get flag option values
logger.Debugf("%s","This is a debug log")
logger.Infof("%s","This is an info log")
logger.Warnf("%s","This is a warn log")
logger.Errorf("%s","This is an error log")
logger.Fatalf("%s","This is a fatal log")

Example log: ERROR 2021-01-26T14:37:17+03:00 1.0.0 Test logging main.go:25

Level

Logger package default log level is Info. If Debug logging is enabled, then all the levels will be logged. You can set log level to Debug with the helper below:

logger.SetDebugLogging(true)

logger's People

Contributors

yakuter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ccgoworld

logger's Issues

Log file path setting

Hello, the log file is created in the main directory. Is there any possibility to manage this from the outside?

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.