zlog

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2019 License: MIT Imports: 3 Imported by: 4

README

logo

Build Status Coverage Status GoDoc Go Report Card license

zlog

Just Log Basic On zerolog

Install

$ go get -u github.com/haozibi/zlog

Demo

package main

import (
	"os"

	"github.com/haozibi/zlog"
)

func init() {

	zlog.NewBasicLog(os.Stdout)
	// zlog.NewJSONLog(os.Stdout)
}

func main() {
	zlog.ZInfo().
		Int("z", 100-1).
		Msg("just do it")

	zlog.ZDebug().
		Float64("f", 3.1415926).
		Msgf("hello %s", "zlog")
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TimeFieldFormat = time.RFC3339

	TimeFormatUnixNano = "2006-01-02 15:04:05.999999999"

	NoColor = false
)

Functions

func Debugf

func Debugf(format string, v ...interface{})

Debugf debug format

func NewBasicLog

func NewBasicLog(w io.Writer)

func NewJSONLog

func NewJSONLog(w io.Writer)

func ZDebug

func ZDebug() *zerolog.Event

func ZError

func ZError() *zerolog.Event

func ZFatal

func ZFatal() *zerolog.Event

func ZInfo

func ZInfo() *zerolog.Event

func ZWarn

func ZWarn() *zerolog.Event

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL