package
1.4.12
Repository: https://github.com/cxuhua/xweb.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

AddModuleLevel wraps a log backend with knobs to have different log levels for different modules.
No description provided by the author
No description provided by the author
ConvertColors takes a list of ints representing colors for log levels and converts them into strings for ANSI color formatting.
GetLevel returns the logging level for the specified module.
GetLogger creates and returns a Logger object based on the module name.
InitForTesting is a convenient method when using logging in a test.
LogLevel returns the log level from a string representation.
MultiLogger creates a logger which contain multiple loggers.
MustGetLogger is like GetLogger but panics if the logger can't be created.
MustStringFormatter is equivalent to NewStringFormatter with a call to panic on error.
NewBackendFormatter creates a new backend which makes all records that passes through it beeing formatted by the specific formatter.
NewChannelMemoryBackend creates a simple in-memory logging backend which utilizes a go channel for communication.
NewLogBackend creates a new LogBackend.
NewMemoryBackend creates a simple in-memory logging backend.
NewStringFormatter returns a new Formatter which outputs the log record as a string based on the 'verbs' specified in the format string.
NewSyslogBackend connects to the syslog daemon using UNIX sockets with the given prefix.
NewSyslogBackendPriority is the same as NewSyslogBackend, but with custom syslog priority, like syslog.LOG_LOCAL3|syslog.LOG_DEBUG etc.
Redact returns a string of * having the same length as s.
Reset restores the internal state of the logging library.
SetBackend replaces the backend currently set with the given new logging backend.
SetFormatter sets the default formatter for all new backends.
SetLevel sets the logging level for the specified module.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Log levels.
Log levels.
Log levels.
Log levels.
Log levels.
Log levels.

# Variables

DefaultFormatter is the default formatter used and is only the message.
ErrInvalidLogLevel is used when an invalid log level has been used.
GlogFormatter mimics the glog format.

# Structs

ChannelMemoryBackend is very similar to the MemoryBackend, except that it internally utilizes a channel.
LogBackend utilizes the standard log module.
Logger is the actual logger which creates log records based on the functions called and passes them to the underlying logging backend.
MemoryBackend is a simple memory based logging backend that will not produce any output but merly keep records, up to the given size, in memory.
Record represents a log record and contains the timestamp when the record was created, an increasing id, filename and line and finally the actual formatted log line.
SyslogBackend is a simple logger to syslog backend.

# Interfaces

Backend is the interface which a log backend need to implement to be able to be used as a logging backend.
Formatter is the required interface for a custom log record formatter.
Leveled interface is the interface required to be able to add leveled logging.
LeveledBackend is a log backend with additional knobs for setting levels on individual modules to different levels.
Redactor is an interface for types that may contain sensitive information (like passwords), which shouldn't be printed to the log.

# Type aliases

Level defines all available log levels for log messages.