Categorygithub.com/exploratoryengineering/logging
modulepackage
0.0.0-20181106085733-dcb8702a004e
Repository: https://github.com/exploratoryengineering/logging.git
Documentation: pkg.go.dev

# README

Logging

GoDoc Build Status Go Report Card codecov

This is a simple logging library for Go. It provides two outputs -- syslog and stderr. The stderr output can colour-code the output with ANSI escape codes, making it easy to vgrep the output on services during development.

# Functions

Debug adds a debug-level log message to the log.
EnableMemoryLogger turns on logging to a memory logger.
EnableNamedSyslog enables sending logs to syslog with the given name.
EnableStderr enables logging to stderr.
EnableSyslog enables syslog logging with the name "congress".
Error adds an error-level log message to the log.
Info adds an info-level log message to the log if the log level is set to InfoLevel or lower.
NewLogEntry creates a new log entry.
NewMemoryLogger creates a new memory logger.
NewMemoryLoggers is a convenience function to create logs for all levels.
NewTerminalLogger creates a new TerminalLogger instance using the specified MemoryLogger instances.
ResetColors prints the ANSI color reset code.
SetLogLevel sets the logging level.
Warning adds a warning-level log message if the log level is set to WarningLevel or lower.

# Constants

DebugLevel is the most detailed logging level.
ErrorLevel is the log level that only logs errors.
InfoLevel is the log level that will log info, warning and errors.
MemoryLoggerFlags is the assumed layout for the log.
WarningLevel is the log level that will log warnings and errors.

# Structs

LogEntry is a linked list entry that holds log entries.
MemoryLogger is a type that logs to memory.
TerminalLogger is a logger that creates a console logging screen with logs that can be toggled runtime.