slog

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2020 License: MIT, Unlicense, Unlicense Imports: 5 Imported by: 0

README

slog

Flexible, extensible logging framework designed to be extended arbitrarily to enable any kind of log output or handling.

Rationale

Concurrent programming is quite unsuited to the use of debuggers as they are generally only designed to follow a single path of execution. Much more useful is to have the ability to watch the activity of multiple threads of execution.

The standard library for logging is very simple and does not lend itself to easy extension, unlike the error library, which can be extended as it defines its function set in an interface.

The debugging method that the author of this library uses involves making use of the hypertext linking functions and opening of source code at code locations relevant to an error. The error library has been extended and plans exist to augment it such that errors can now be even further deeply embedded in multiple layers of execution. This is good and well for errors that can be handled, but it just further obstructs the ease of eliminating unexpected errors caused by incorrect algorithms.

As such, this library comes with a minimal implementation that prints out code locations of the site of the error so that the developer can immediately jump to the site of the problem and trace it more easily back to its origin.

Documentation

Overview

Package log creates a neat short access to logger functions for a simple app-wide namespace (package global, this package need only be imported) for use of slog/simple logger implementation

Index

Constants

This section is empty.

Variables

View Source
var (
	Fatal      func(txt ...interface{})
	Error      func(txt ...interface{})
	Warn       func(txt ...interface{})
	Info       func(txt ...interface{})
	Debug      func(txt ...interface{})
	Trace      func(txt ...interface{})
	Fatalf     func(format string, txt ...interface{})
	Errorf     func(format string, txt ...interface{})
	Warnf      func(format string, txt ...interface{})
	Infof      func(format string, txt ...interface{})
	Debugf     func(format string, txt ...interface{})
	Tracef     func(format string, txt ...interface{})
	Fatals     func(txt interface{})
	Errors     func(txt interface{})
	Warns      func(txt interface{})
	Infos      func(txt interface{})
	Debugs     func(txt interface{})
	Traces     func(txt interface{})
	Check      func(err error) bool
	SetPrinter func(fn logi.Printer)
	SetLevel   func(level logi.Level)
)

The following are slots that can be loaded for an app-wide logger

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package Entry is a message type for logi log entries
Package Entry is a message type for logi log entries
Pkg
Package Package is a message type for logi package filtering
Package Package is a message type for logi package filtering
Pk
Package consume turns off and on the Serve logging messages and provides a way to receive and process the log messages
Package consume turns off and on the Serve logging messages and provides a way to receive and process the log messages
Package logi is a logger interface designed to allow easy extension with log printer functions and complete reimplementation as required
Package logi is a logger interface designed to allow easy extension with log printer functions and complete reimplementation as required
Package serve receives logi.Entry messages on a channel and sends them when it has been told to Run by Consume, and pauses when it is told Pause
Package serve receives logi.Entry messages on a channel and sends them when it has been told to Run by Consume, and pauses when it is told Pause
Package simple is an implementation of the logi.Logger interface that prints log entries to stdout with level code, compact since startup time.Duration and appends the code location of the call to the logger at the end of the log text.
Package simple is an implementation of the logi.Logger interface that prints log entries to stdout with level code, compact since startup time.Duration and appends the code location of the call to the logger at the end of the log text.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL