Giter Site home page Giter Site logo

5up3rc / golog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kataras/golog

0.0 0.0 0.0 79 KB

A high-performant Logging Foundation for Go Applications. X3 faster than the rest leveled loggers.

License: BSD 3-Clause "New" or "Revised" License

Go 100.00%

golog's Introduction

✒️ golog

golog is a simple, fast and easy-to-use level-based logger written entirely in GoLang.

Output from win terminal

build status report card godocs github issues

🥇 Features

  • Focus on high performance and agile perspective of things
  • Easy API and a default package-level instance, i.e golog#Fatalf/Errorf/Warnf/Infof/Debugf
  • Fully compatible with the standard library
  • Thanks to the pio library it supports any type of structure, gives you the ability to Hijack and Handle or Intercept the on-going logs too
  • Set or even Add unlimited number of output targets, io.Writer
  • Scan from any io.Reader and log to the defined output target(s)
  • Levels such as fatal,error, warn, info, debug, or disable
  • Beautiful (customizable) colors for leveled logs, automatically omit colors when output does not support colors (i.e files)
  • Incredible high-performant, 3 times faster than your favourite logger
  • Never-Panics

Navigate through _examples and integrations to learn if that fair solution suits your needs.

🚀 Installation

The only requirement is the Go Programming Language*.

$ go get github.com/kataras/golog

golog is fairly built on top of the pio library, it has no more external dependencies.

package main

import (
    "github.com/kataras/golog"
)

func main() {
    // Default Output is `os.Stdout`,
    // but you can change it:
    // golog.SetOutput(os.Stderr)

    // Time Format defaults to: "2006/01/02 15:04"
    // you can change it to something else or disable it with:
    golog.SetTimeFormat("")

    // Level defaults to "info",
    // but you can change it:
    golog.SetLevel("debug")

    golog.Println("This is a raw message, no levels, no colors.")
    golog.Info("This is an info message, with colors (if the output is terminal)")
    golog.Warn("This is a warning message")
    golog.Error("This is an error message")
    golog.Debug("This is a debug message")
    golog.Fatal("Fatal will exit no matter what, but it will also print the log message if logger's Level is >=FatalLevel")
}

Examples

🔥 Benchmarks

test times ran (large is better) ns/op (small is better) B/op (small is better) allocs/op (small is better)
BenchmarkGologPrint 10000000 3749 ns/op 890 B/op 28 allocs/op
BenchmarkLogrusPrint   3000000 9609 ns/op 1611 B/op 64 allocs/op

Click here for details.

👥 Contributing

If you find that something is not working as expected please open an issue.

📦 Projects using golog

Package Author Description
iris Gerasimos Maropoulos The fastest web framework for Go in (THIS) Earth. HTTP/2 Ready-To-GO. Mobile Ready-To-GO.

Do not hesitate to put your package on this list via PR!

golog's People

Contributors

kataras 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.