Documentation ¶
Index ¶
- Constants
- func DisableLoggingFile()
- func GetFlags() int
- func GetLoggingFile() (bool, string)
- func GetPrefix() string
- func GetStream() io.Writer
- func Log(logType int, msg string)
- func Logf(logType int, format string, a ...any)
- func NewlineWithoutPrefix()
- func SetFlags(newFlags int)
- func SetLoggingFile(file string)
- func SetPrefix(newPrefix string)
- func SetStream(stream io.Writer)
Constants ¶
const ( // LogInfo is used to log information messages LogInfo = iota // LogError is used to log error messages LogError // LogWarning is used to log warning messages LogWarning // LogDebug is used to log debug messages LogDebug // LogFatal is used log fatal messages and quit LogFatal // LogNoPrefix sets the type prefix to nothing. LogNoPrefix )
Log type constants
Variables ¶
This section is empty.
Functions ¶
func DisableLoggingFile ¶
func DisableLoggingFile()
Disables file logging and sets the file to the empty string("").
func GetLoggingFile ¶
Returns if file logging is enabled and, if so, the path to the file.
func Log ¶
Log a message with a specified log type. Use the log type constants(LogInfo, LogError, LogWarning, LogDebug, and LogFatal) for the log type.
func NewlineWithoutPrefix ¶
func NewlineWithoutPrefix()
Logs a newline without any prefix(including the time, the custom prefix, and anything else from custom flags).
func SetFlags ¶
func SetFlags(newFlags int)
Sets the logger's flags. Use the flags from the log package. log.Lmsgprefix is automatically set.
func SetLoggingFile ¶
func SetLoggingFile(file string)
Sets the logging file to the specified value, enabling file logging if necessary. If the file passed is the empty string(""), then it will disable file logging.
Passing an empty string is equivalent to calling DisableLoggingFile.
Types ¶
This section is empty.