Documentation ¶
Index ¶
- type Entry
- type Fields
- type Gol
- func (gol *Gol) FileSync()
- func (gol *Gol) GDebugf(format string, args ...interface{})
- func (gol *Gol) GErrorf(format string, args ...interface{})
- func (gol *Gol) GInfof(format string, args ...interface{})
- func (gol *Gol) GWithFields(fields Fields) *Entry
- func (gol *Gol) Printf(format string, args ...interface{})
- func (gol *Gol) SetFileOutput(filename string) error
- func (gol *Gol) WithFields(fields Fields) *Entry
- type HookAutoFileDate
- type HookPrinter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Gol ¶
type Gol struct { *logrus.Logger // Mutex Locking is enabled by Default to protect OSFile and sensitive feilds MU logrus.MutexWrap OSFile *os.File FullPath string EnableAutoSync bool // Disable by default }
Gol logrus.Logger with additional features
func New ¶
func New() *Gol
New Creates a new gol logger. Configuration should be set by changing `Formatter`, `Out` and `Hooks` directly on the default logger instance. You can also just instantiate your own:
var log = &Gol{ Logger: &logrus.Logger{ Out: os.Stderr, Formatter: new(logrus.TextFormatter), Hooks: make(logrus.LevelHooks), Level: logrus.InfoLevel, }, OSFile: nil, FullPath: "", }
It's recommended to make this a global instance called `log`.
func NewWithHookAutoFileDate ¶
func NewWithHookPrinter ¶
func NewWithHookPrinter() *Gol
func (*Gol) GWithFields ¶
GWithFields Adds a struct of fields to the log entry.
func (*Gol) SetFileOutput ¶
SetFileOutput Util method to set output to file
func (*Gol) WithFields ¶
WithFields Shadowing low level WithFields() method to prevent argument type error.
type HookAutoFileDate ¶
type HookAutoFileDate struct { Logger *Gol TimeLocation *time.Location Logpath string // contains filtered or unexported fields }
func (*HookAutoFileDate) FileDateHandler ¶
func (h *HookAutoFileDate) FileDateHandler()
func (*HookAutoFileDate) Fire ¶
func (h *HookAutoFileDate) Fire(entry *logrus.Entry) error
Fire HookAutoFileDate Auto print log to stdout
func (*HookAutoFileDate) Levels ¶
func (h *HookAutoFileDate) Levels() []logrus.Level
type HookPrinter ¶
type HookPrinter struct { }
HookPrinter ...
func (*HookPrinter) Levels ¶
func (h *HookPrinter) Levels() []logrus.Level
Click to show internal directories.
Click to hide internal directories.