log

package module
v0.0.0-...-768e1f3 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Apache-2.0 Imports: 11 Imported by: 2

README

log

1609-09-12 19:02:35 PM +03:00 Sep Sat PDT
--------------- + ------------ + ------------
Type            | Placeholder  | Value
--------------- + ------------ + ------------
Year            | 2006         | 1609
Year            | 06           | 09
Month           | 01           | 09
Month           | 1            | 9
Month           | Jan          | Sep
Month           | January      | September
Day             | 02           | 12
Day             | 2            | 12
Week day        | Mon          | Sat
Week day        | Monday       | Saturday
Hours           | 03           | 07
Hours           | 3            | 7
Hours           | 15           | 19
Minutes         | 04           | 02
Minutes         | 4            | 2
Seconds         | 05           | 35
Seconds         | 5            | 35
AM or PM        | PM           | PM
Milliseconds    | .000         | .123
Microseconds    | .000000      | .123456
Nanoseconds     | .000000000   | .123456789
Timezone offset | -0700        | +0300
Timezone offset | -07:00       | +03:00
Timezone offset | Z0700        | +0300
Timezone offset | Z07:00       | +03:00
Timezone        | MST          | PDT
--------------- + ------------ + ------------

Documentation

Index

Constants

View Source
const (
	DEBUG = iota
	INFO
	WARN
	ERROR
	FATAL
)

Level

Variables

This section is empty.

Functions

func Debugf

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

Debugf default debug

func Errorf

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

Errorf default errorf

func Goid

func Goid() string

Goid get gourtine id

func Infof

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

Infof default infof

func Warnf

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

Warnf default warnf

Types

type Log

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

Log log

func DefaultFileLog

func DefaultFileLog(path ...string) *Log

DefaultFileLog default file log

func DefaultStdLog

func DefaultStdLog() *Log

DefaultStdLog default std log

func New

func New(opts ...Option) *Log

New Log

func (*Log) Debugf

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

Debugf log debug info

func (*Log) Errorf

func (l *Log) Errorf(format string, v ...interface{})

Errorf log error info

func (*Log) Infof

func (l *Log) Infof(format string, v ...interface{})

Infof log info info

func (*Log) Panicf

func (l *Log) Panicf(format string, v ...interface{})

Panicf log panic info

func (*Log) SetLevel

func (l *Log) SetLevel(lv int)

SetLevel set level

func (*Log) Warnf

func (l *Log) Warnf(format string, v ...interface{})

Warnf log warn info

type Logger

type Logger interface {
	Debugf(string, ...interface{})
	Infof(string, ...interface{})
	Warnf(string, ...interface{})
	Errorf(string, ...interface{})
}

Logger log interface

type Option

type Option func(*Options)

Option Options function

func Writer

func Writer(writer io.Writer) Option

Writer writer

type Options

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

Options options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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