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
- func Debug(format string, v ...interface{})
- func Error(format string, v ...interface{})
- func Fatal(format string, v ...interface{})
- func Info(format string, v ...interface{})
- func InitFileLog(dir, module, level string)
- func Panic(format string, v ...interface{})
- func Warn(format string, v ...interface{})
- type Log
- func (l *Log) Debug(format string, v ...interface{})
- func (l *Log) Error(format string, v ...interface{})
- func (l *Log) Fatal(format string, v ...interface{})
- func (l *Log) Info(format string, v ...interface{})
- func (l *Log) IsEnableDebug() bool
- func (l *Log) IsEnableError() bool
- func (l *Log) IsEnableInfo() bool
- func (l *Log) IsEnableTrace() bool
- func (l *Log) IsEnableWarn() bool
- func (l *Log) Output(calldepth int, s string, sync bool)
- func (l *Log) Panic(format string, v ...interface{})
- func (l *Log) SetLevel(level string)
- func (l *Log) SetPrefix(s, level string) string
- func (l *Log) Warn(format string, v ...interface{})
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 InitFileLog ¶
func InitFileLog(dir, module, level string)
Types ¶
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
func GetFileLogger ¶
func GetFileLogger() *Log
func NewDefaultLog ¶
func NewDefaultLog() *Log
func (*Log) IsEnableDebug ¶
func (*Log) IsEnableError ¶
func (*Log) IsEnableInfo ¶
func (*Log) IsEnableTrace ¶
func (*Log) IsEnableWarn ¶
Click to show internal directories.
Click to hide internal directories.