log

package
v0.0.0-...-b25a44a Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 9 Imported by: 12

Documentation

Overview

Copyright 2018 The tiglabs raft Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// A colon appears after these items:  2009/01/23 01:23:23.123123 /a/b/c/d.go:23: message
	Ldate         = 1 << iota     // the date: 2009/01/23
	Ltime                         // the time: 01:23:23
	Lmicroseconds                 // microsecond resolution: 01:23:23.123123.  assumes Ltime.
	Llongfile                     // full file name and line number: /a/b/c/d.go:23
	Lshortfile                    // final file name element and line number: d.go:23. overrides Llongfile
	LstdFlags     = Ldate | Ltime // initial values for the standard logger

	LogFileNameDateFormat = "2006-01-02"
)
View Source
const (
	TraceLevel = 0
	DebugLevel = 1
	InfoLevel  = 2
	WarnLevel  = 3
	ErrorLevel = 4
	FatalLevel = 5
)

Variables

This section is empty.

Functions

func Debug

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

func Error

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

func Fatal

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

func Info

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

func InitFileLog

func InitFileLog(dir, module, level string)

func Panic

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

func Warn

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

Types

type Log

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

func GetFileLogger

func GetFileLogger() *Log

func NewDefaultLog

func NewDefaultLog() *Log

func NewLog

func NewLog(dir, module, level string) (*Log, error)

func (*Log) Debug

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

func (*Log) Error

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

func (*Log) Fatal

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

func (*Log) Info

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

func (*Log) IsEnableDebug

func (l *Log) IsEnableDebug() bool

func (*Log) IsEnableError

func (l *Log) IsEnableError() bool

func (*Log) IsEnableInfo

func (l *Log) IsEnableInfo() bool

func (*Log) IsEnableTrace

func (l *Log) IsEnableTrace() bool

func (*Log) IsEnableWarn

func (l *Log) IsEnableWarn() bool

func (*Log) Output

func (l *Log) Output(calldepth int, s string, sync bool)

func (*Log) Panic

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

func (*Log) SetLevel

func (l *Log) SetLevel(level string)

func (*Log) SetPrefix

func (l *Log) SetPrefix(s, level string) string

func (*Log) Warn

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

Jump to

Keyboard shortcuts

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