package
1.0.0
Repository: https://github.com/coscms/webx.git
Documentation: pkg.go.dev

# README

log

GoDoc

简体中文

Installation

go get github.com/lunny/log

Features

  • Add color support for unix console
  • Implemented dbwriter to save log to database
  • Implemented FileWriter to save log to file by date or time.

Example

For Single File:

f, _ := os.Create("my.log")
log.Std.SetOutput(f)

For Multiple Writer:

f, _ := os.Create("my.log")
log.Std.SetOutput(io.MultiWriter(f, os.Stdout))

For log files by date or time:

w := log.NewFileWriter(log.FileOptions{
    ByType:log.ByDay,
    Dir:"./logs",
})
log.Std.SetOutput(w)

About

This repo is an extension of Golang log.

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Fatal is equivalent to Print() followed by a call to os.Exit(1).
Fatalf is equivalent to Printf() followed by a call to os.Exit(1).
Flags returns the output flags for the standard logger.
No description provided by the author
No description provided by the author
No description provided by the author
New creates a new Logger.
No description provided by the author
No description provided by the author
No description provided by the author
Panic is equivalent to Print() followed by a call to panic().
Panicf is equivalent to Printf() followed by a call to panic().
Prefix returns the output prefix for the standard logger.
Print calls Output to print to the standard logger.
Printf calls Output to print to the standard logger.
Println calls Output to print to the standard logger.
No description provided by the author
MUST called before all logs.
No description provided by the author
SetFlags sets the output flags for the standard logger.
MUST called before all logs.
SetOutput sets the output destination for the standard logger.
No description provided by the author
SetPrefix sets the output prefix for the standard logger.
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

40.
44.
46.
42.
45.
41.
47.
43.
No description provided by the author
No description provided by the author
No description provided by the author
30.
34.
36.
32.
35.
31.
37.
33.
No description provided by the author
the date: 2009/0123.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
level: 0(Debug), 1(Info), 2(Warn), 3(Error), 4(Panic), 5(Fatal).
color will start [info] end of line.
full file name and line number: /a/b/c/d.go:23.
microsecond resolution: 01:23:23.123123.
module name.
No description provided by the author
No description provided by the author
color only include [info].
final file name element and line number: d.go:23.
initial values for the standard logger.
the time: 01:23:23.
No description provided by the author

# Variables

No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
A Logger represents an active logging object that generates lines of output to an io.Writer.

# Type aliases

No description provided by the author