Documentation ¶
Index ¶
- Constants
- func AddConsoleLog(Logger *logrus.Logger)
- func CreateLogger(logPath string, logName string, logLevel string, sign string) (*logrus.Logger, error)
- func InitConsoleLog(debug bool, sign string)
- func InitLog(debug bool, logFilePath string, sign string) error
- func IsDebug(level logrus.Level) bool
- type ConsoleHook
- type DragonflyFormatter
Constants ¶
View Source
const DefaultLogTimeFormat = "2006-01-02 15:04:05.000"
DefaultLogTimeFormat defines the timestamp format.
Variables ¶
This section is empty.
Functions ¶
func AddConsoleLog ¶
AddConsoleLog will add a ConsoleLog into Logger's hooks. It will output logs to console when Logger's outputting logs.
func CreateLogger ¶
func CreateLogger(logPath string, logName string, logLevel string, sign string) (*logrus.Logger, error)
CreateLogger creates a Logger.
func InitConsoleLog ¶
InitConsoleLog initializes console logger for process. console log will output the dfget client's log in console/terminal for debugging usage.
Types ¶
type ConsoleHook ¶
type ConsoleHook struct {
// contains filtered or unexported fields
}
ConsoleHook shows logs on console.
func (*ConsoleHook) Fire ¶
func (ch *ConsoleHook) Fire(entry *logrus.Entry) error
Fire implements Hook#Fire.
func (*ConsoleHook) Levels ¶
func (ch *ConsoleHook) Levels() []logrus.Level
Levels implements Hook#Levels().
type DragonflyFormatter ¶
type DragonflyFormatter struct { // TimestampFormat sets the format used for marshaling timestamps. TimestampFormat string Sign string }
DragonflyFormatter customizes the dragonfly log format.
Click to show internal directories.
Click to hide internal directories.