log

package
v0.0.0-...-df740be Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package log log util Author: Frank Lee Date: 2017-08-06 14:15:48 Last Modified by: Frank Lee Last Modified time: 2017-09-08 10:44:35

Index

Constants

View Source
const (

	// Trace trace level
	Trace = iota

	// Info info level
	Info

	// Warn warn level
	Warn

	// Error error level
	Error

	// Fatal fatal level
	Fatal
)
View Source
const (

	// Day 2006-01-02
	Day = 1 << iota
	// Time 15:04:05
	Time
	// Lfile full path of file
	Lfile
	// Sfile file name only
	Sfile
	// Std Day|Time|Sfile
	Std
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger logger

func NewLogger

func NewLogger(path string, option *LoggerOption) *Logger

NewLogger new logger

func (*Logger) Error

func (logger *Logger) Error(format string, a ...interface{})

Error error level logs

func (*Logger) Fatal

func (logger *Logger) Fatal(format string, a ...interface{})

Fatal fatal level logs

func (*Logger) Info

func (logger *Logger) Info(format string, a ...interface{})

Info info level logs

func (*Logger) Trace

func (logger *Logger) Trace(format string, a ...interface{})

Trace trace level logs

func (*Logger) Warn

func (logger *Logger) Warn(format string, a ...interface{})

Warn warn level logs

type LoggerOption

type LoggerOption struct {
	Level    int
	MaxLine  int
	MaxSize  int
	Mode     int
	Compress bool
	LeftDay  int
}

LoggerOption logger options

Jump to

Keyboard shortcuts

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