Documentation
¶
Index ¶
Constants ¶
const (
AutoLogFile = "auto"
)
Variables ¶
This section is empty.
Functions ¶
func CloseFileHooks ¶
CloseFileHooks will close each file being used for each FileHook attached to the logger. If the logger passed is nil, will reference the logrus.StandardLogger().
Types ¶
type FileHook ¶
type FileHook struct {
// Logger is a reference to the internal Logger that this utilizes.
Logger *logrus.Logger
// File is a reference to the file being written to.
File *os.File
// FilePath is the full path used when creating the file.
FilePath string
// Closed reports whether the hook has been closed. Once closed
// it can't be written to again.
Closed bool
}
FileHook to send logs to the trace file regardless of CLI level.
func GetFileHooks ¶
func GetFileHooks(obj interface{}) []*FileHook
GetFileHooks is a convenience method to take an object and returns the FileHooks attached to it. Accepts an interface{} since the logger objects may be put into context or thread objects. The obj should be a *logrus.Logger object.
func GetFirstFileHook ¶
func GetFirstFileHook(obj interface{}) *FileHook
GetFirstFileHook is a convenience method to take an object and returns the first FileHook attached to it. Accepts an interface{} since the logger objects may be put into context or thread objects. The obj should be a *logrus.Logger object.