glogging

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 6 Imported by: 9

Documentation

Overview

logger customs go.uber.org/zap logger with level, caller context and rorate file via github.com/natefinch/lumberjack.

Index

Constants

This section is empty.

Variables

View Source
var Logger *zap.Logger

Functions

func Init

func Init(logpaths []string, loglevel Loglevel)

Init customs go.uber.org/zap glogging.

parameter logpaths available value: stdout,stderr,path/to/file;
parameter loglevel

func LoglevelStr2uint added in v0.0.12

func LoglevelStr2uint(loglevel Loglevel) (rs zapcore.Level)

LoglevelStr2uint converts logging level from a string into zapcore.Level.

Types

type Loglevel added in v0.0.10

type Loglevel string
const (
	DEBUG Loglevel = "debug"
	WARN  Loglevel = "warn"
	ERROR Loglevel = "error"
	FATAL Loglevel = "fatal"
)

func String2LogLevel added in v0.0.12

func String2LogLevel(s string) Loglevel

String2LogLevel convert level name string into glogging.Loglevel type

Jump to

Keyboard shortcuts

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