Documentation ¶
Overview ¶
* Copyright (C) 2020 The poly network Authors * This file is part of The poly network library. * * The poly network is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The poly network is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with The poly network . If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func CheckIfNeedNewFile() bool
- func ClosePrintLog() error
- func Color(code, msg string) string
- func Debug(a ...interface{})
- func Debugf(format string, a ...interface{})
- func Error(a ...interface{})
- func Errorf(format string, a ...interface{})
- func Fatal(a ...interface{})
- func Fatalf(format string, a ...interface{})
- func FileOpen(path string) (*os.File, error)
- func GetGID() uint64
- func GetLogFileSize() (int64, error)
- func GetMaxLogChangeInterval(maxLogSize int64) int64
- func Info(a ...interface{})
- func Infof(format string, a ...interface{})
- func Init(a ...interface{})
- func InitLog(logLevel int, a ...interface{})
- func LevelName(level int) string
- func NameLevel(name string) int
- func Trace(a ...interface{})
- func Tracef(format string, a ...interface{})
- func Warn(a ...interface{})
- func Warnf(format string, a ...interface{})
- type Logger
- func (l *Logger) Debug(a ...interface{})
- func (l *Logger) Debugf(format string, a ...interface{})
- func (l *Logger) Error(a ...interface{})
- func (l *Logger) Errorf(format string, a ...interface{})
- func (l *Logger) Fatal(a ...interface{})
- func (l *Logger) Fatalf(format string, a ...interface{})
- func (l *Logger) Info(a ...interface{})
- func (l *Logger) Infof(format string, a ...interface{})
- func (l *Logger) Output(level int, a ...interface{}) error
- func (l *Logger) Outputf(level int, format string, v ...interface{}) error
- func (l *Logger) SetDebugLevel(level int) error
- func (l *Logger) Trace(a ...interface{})
- func (l *Logger) Tracef(format string, a ...interface{})
- func (l *Logger) Warn(a ...interface{})
- func (l *Logger) Warnf(format string, a ...interface{})
Constants ¶
const ( Blue = "0;34" Red = "0;31" Green = "0;32" Yellow = "0;33" Cyan = "0;36" Pink = "1;35" )
const ( TraceLog = iota DebugLog InfoLog WarnLog ErrorLog FatalLog MaxLevelLog )
const ( NAME_PREFIX = "LEVEL" CALL_DEPTH = 2 DEFAULT_MAX_LOG_SIZE = 20 BYTE_TO_MB = 1024 * 1024 PATH = "./logoutput/" )
Variables ¶
var (
Stdout = os.Stdout
)
Functions ¶
func CheckIfNeedNewFile ¶
func CheckIfNeedNewFile() bool
func ClosePrintLog ¶
func ClosePrintLog() error
func GetLogFileSize ¶
func GetMaxLogChangeInterval ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
var Log *Logger