A powerful zero-dependency json logger.

Overview

ZKits Logger Library

ZKits Build Status Build status Coverage Status Codacy Badge Go Report Card Golang Version

About

This package is a library of ZKits project. This is a zero-dependency standard JSON log library that supports structured JSON logs and is compatible with the standard library.

  • Flexible and controllable caller report.
  • Support 7 log levels.
  • Complete log standard library compatibility.
  • Chained call, supporting additional log context data.
  • Flexible log hook support.
  • Custom log formatter support.

Install

go get -u -v github.com/edoger/zkits-logger

Usage

package main

import (
    "github.com/edoger/zkits-logger"
)

func main() {
    // Creates a logger instance with the specified name.
    log := logger.New("test")

    // {"level":"info","message":"Something happened.","name":"test","time":"2020-02-20T20:20:20+08:00"}
    log.Info("Something happened.")

    // {"fields":{"num":1},"level":"info","message":"Something happened.","name":"test","time":"2020-02-20T20:20:20+08:00"}
    log.WithField("num", 1).Info("Something happened.")
}

License

Apache-2.0

Issues
Releases(v1.4.5)
  • v1.4.5(Apr 15, 2022)

    • Add mutex writer wrapper for logger.
    • Add log call stack support.
    • Hide the name when the logger name is empty.
    • Some internal details and performance optimizations.
    Source code(tar.gz)
    Source code(zip)
  • v1.4.4(Dec 3, 2021)

    • Add Logger.AsLog method: convert the current Logger instance to a Log instance.
    • Support automatic cleaning of old log files. [BREAK]
    • Provides a multi-channel writer.
    • Add built-in console log formatter.
    Source code(tar.gz)
    Source code(zip)
  • v1.4.3(Jun 28, 2021)

  • v1.4.2(May 3, 2021)

    • Add default quote text formatter.
    • Use short capital level text for the default provided text formatter.
    • Add log file writer.
    • Optimize the performance of json log.
    Source code(tar.gz)
    Source code(zip)
  • v1.4.1(Apr 14, 2021)

  • v1.4.0(Apr 10, 2021)

    • Add a text formatter.
    • Add a json formatter.
    • Supports customizing the field names of the top-level objects of json logs.
    • Show the logger name to the internal error message header.
    Source code(tar.gz)
    Source code(zip)
  • v1.3.3(Feb 7, 2021)

    • Make sure that the write log data is not empty.
    • ~Add AllLevels() function to get all supported log levels.~ Remove from v1.4.1
    • Add log output interceptor support.
    Source code(tar.gz)
    Source code(zip)
  • v1.3.2(Dec 31, 2020)

  • v1.3.1(Dec 29, 2020)

  • v1.3.0(Dec 28, 2020)

    • Extends the string format of the log level.
    • By default, empty log fileds is not output.
    • Log caller support.
    • Modify the internal function call stack depth of the logger.
    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Dec 23, 2020)

  • v1.1.1(Nov 16, 2020)

  • v1.1.0(Nov 11, 2020)

  • v1.0.0(Apr 8, 2020)

Owner
Qingshan Luo
竹外桃花三两枝,春江水暖鸭先知。
Qingshan Luo
Zero Allocation JSON Logger

Zero Allocation JSON Logger The zerolog package provides a fast and simple logger dedicated to JSON output. Zerolog's API is designed to provide both

Olivier Poitrey 6.5k Jul 5, 2022
Convenient Logger interface and std logger wrapper

Convenient logger interface and wrapper around std logger Interface type Logger interface { Error(err error) Debugf(format string, args ...interface

Denis Mitrofanov 1 Nov 28, 2021
Logger - Simple logger without written with std pkg

Go-Logger Simple usage is: package main

MaskedTrench 2 Jan 2, 2022
Logger - A thin wrapper of uber-go/zap logger for personal project

a thin wraper of uber-go/zap logger for personal project 0. thanks uber-go/zap B

tsingson 1 Jun 16, 2022
Simple Yet Powerful Logger

sypl sypl provides a Simple Yet Powerful Logger built on top of the Golang sypl. A sypl logger can have many Outputs, and each Output is responsible f

Sauce Labs 9 Apr 28, 2022
Dead simple, super fast, zero allocation and modular logger for Golang

Onelog Onelog is a dead simple but very efficient JSON logger. It is one of the fastest JSON logger out there. Also, it is one of the logger with the

Francois Parquet 399 Jun 16, 2022
A simple Go JSON logger.

logger A simple JSON logger for Go. It uses a context.Context to store values which will then be logged along with each message. It is possible to rec

Shawn Milochik 1 Dec 20, 2021
This package enables json output, level logging and so on to standard go logger.

logplug This package enables json output, level logging and so on to standard logger. Usage log.SetOutput(logplug.NewJSONPlug(os.Stderr, logplug.LogF

Koumei Mikuni 0 Dec 27, 2021
A logger, for Go

Go-Log A logger, for Go! It's sort of log and code.google.com/p/log4go compatible, so in most cases can be used without any code changes. Breaking cha

Ian Kent 38 May 12, 2022
Simple logger for Go programs. Allows custom formats for messages.

go-logger A simple go logger for easy logging in your programs. Allows setting custom format for messages. Preview Install go get github.com/apsdehal/

Amanpreet Singh 276 Jun 14, 2022
Loggly Hooks for GO Logrus logger

Loggly Hooks for Logrus Usage package main import ( "github.com/sirupsen/logrus" "github.com/sebest/logrusly" ) var logglyToken string = "YOUR_LOG

Sebest 27 Jul 27, 2021
A 12-factor app logger built for performance and happy development

logxi log XI is a structured 12-factor app logger built for speed and happy development. Simpler. Sane no-configuration defaults out of the box. Faste

Mario Gutierrez 348 Jun 25, 2022
A logger for Go SQL database driver without modify existing *sql.DB stdlib usage.

SQLDB-Logger A logger for Go SQL database driver without modify existing *sql.DB stdlib usage. Colored console writer output above only for sample/dev

Sarjono Mukti Aji 222 Jul 2, 2022
xlog is a logger for net/context aware HTTP applications

⚠️ Check zerolog, the successor of xlog. HTTP Handler Logger xlog is a logger for net/context aware HTTP applications. Unlike most loggers, xlog will

Olivier Poitrey 135 Nov 22, 2021
Configurable Logger for Go

Timber! This is a logger implementation that supports multiple log levels, multiple output destinations with configurable formats and levels for each.

DeNA SF 67 Dec 27, 2021
A feature-rich and easy to use logger for golang

A feature-rich and easy to use logger for golang ?? Install ?? Common Logs lumber.Success() lumber.Info() lumber.Debug() lumber.Warning()

Matthew Gleich 49 May 26, 2022
A minimal and extensible structured logger

⚠️ PRE-RELEASE ⚠️ DO NOT IMPORT THIS MODULE YOUR PROJECT WILL BREAK package log package log provides a minimal interface for structured logging in ser

Go kit 104 Jun 29, 2022
HTTP request logger for Golang

Horus ?? Introduction Horus is a request logger and viewer for Go. It allows developers log and view http requests made to their web application. Inst

Michael Okoh 78 Jun 5, 2022
simple concurrent logger

XMUS-LOGGER pure golang logger compatible with golang io standards. USAGE : logOptions := logger.LoggerOptions{ LogLevel: 6, // read more about lo

amupxm [amir hossein mokarrami far] 5 Sep 19, 2021