logx

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

* @Author: cnzf1 * @Date: 2019-01-26 15:20:02 * @LastEditors: cnzf1 * @LastEditTime: 2023-03-17 18:36:58 * @Description: 日志组件封装

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Debugf

func Debugf(fmt string, args ...interface{})

func Error

func Error(args ...interface{})

func Errorf

func Errorf(fmt string, args ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(fmt string, args ...interface{})

func Info

func Info(args ...interface{})

func Infof

func Infof(fmt string, args ...interface{})

func Init

func Init(opts ...OptionFunc)

func Panic

func Panic(args ...interface{})

func Panicf

func Panicf(fmt string, args ...interface{})

func SetLogLevel

func SetLogLevel(lvl string)

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(fmt string, args ...interface{})

Types

type OptionFunc added in v1.2.0

type OptionFunc func(c *config)

func WithBackups added in v1.2.0

func WithBackups(maxBackups int) OptionFunc

WithBackups alters the max num of old log files to retain, default 10

func WithCompress added in v1.2.0

func WithCompress(compress bool) OptionFunc

WithCompress determines if the rotated log files should be compressed, default false

func WithLevel added in v1.2.0

func WithLevel(level string) OptionFunc

WithLevel alters the log output level, options: debug/info/warn/error

func WithMaxAge added in v1.2.0

func WithMaxAge(maxAge int) OptionFunc

WithMaxAge alters the max num of days to retain old log files, default 7 days

func WithMaxSize added in v1.2.0

func WithMaxSize(maxSize int) OptionFunc

WithMaxSize alters the max size of a single log file, default 100Mbit

func WithPath added in v1.2.0

func WithPath(filename string) OptionFunc

WithPath alters the saved log full path, for example "./log/debug.log"

Jump to

Keyboard shortcuts

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