Documentation ¶
Index ¶
- Constants
- func FileName(name string, server bool) string
- func Init(fs *assets.FS, file string, level logrus.Level) (*logrus.Logger, *logrus.Logger, error)
- func IsWritable(path string) (isWritable bool, err error)
- func LevelFrom(level int) logrus.Level
- func NewAudit(fs *assets.FS, logDir string) (*logrus.Logger, error)
- func NewDatabase(log *logrus.Entry, level string) logger.Interface
- func NewJSON(fs *assets.FS, file string, level logrus.Level) (*logrus.Logger, error)
- func NewStdio(level logrus.Level) *logrus.Logger
- func NewText(file io.Writer) (*logrus.Logger, error)
Constants ¶
const ( // ClientLogFileExt is used as extension by all main teamclients log files by default. ClientLogFileExt = "teamclient.log" // ServerLogFileExt is used as extension by all teamservers core log files by default. ServerLogFileExt = "teamserver.log" )
const PackageFieldKey = "teamserver_pkg"
PackageFieldKey is used to identify the name of the package specified by teamclients and teamservers named loggers.
Variables ¶
This section is empty.
Functions ¶
func FileName ¶
FileName take a filename without extension and adds the corresponding teamserver/teamclient logfile extension.
func Init ¶
Init is the main constructor that is (and should be) used for teamserver and teamclient logging. It hooks a normal logger with a sublogger writing to a file in text version, and another logger writing to stdout/stderr with enhanced formatting/coloring support.
func IsWritable ¶
IsWritable checks that the given path can be created.
func NewDatabase ¶
NewDatabase returns a logger suitable as logrus database logging middleware.
func NewJSON ¶
NewJSON returns a logger writing to the central log file of the teamserver, JSON-encoded.
Types ¶
This section is empty.