Documentation
¶
Overview ¶
Package skyhook is hook for sirupsen/logrus that used for writing the logs to local files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PathMap ¶
PathMap is map for mapping a log level to a file's path. Multiple levels may share a file, but multiple files may not be used for one level.
type SkyHook ¶
type SkyHook struct {
// contains filtered or unexported fields
}
SkyHook is a hook to handle writing to local log files.
func NewHook ¶
NewHook returns new Sky hook. Output can be a string, io.Writer, WriterMap or PathMap. If using io.Writer or WriterMap, user is responsible for closing the used io.Writer.
func (*SkyHook) Fire ¶
Fire writes the log file to defined path or using the defined writer. User who run this function needs write permissions to the file or directory if the file does not yet exist.
func (*SkyHook) SetDefaultPath ¶
SetDefaultPath sets default path for levels that don't have any defined output path.
func (*SkyHook) SetDefaultWriter ¶
SetDefaultWriter sets default writer for levels that don't have any defined writer.
func (*SkyHook) SetFormatter ¶
SetFormatter sets the format that will be used by hook. If using text formatter, this method will disable color output to make the log file more readable.