modulepackage
0.0.0-20220126205329-1f766c8d0b3c
Repository: https://github.com/structy/log.git
Documentation: pkg.go.dev
# README
structy/log
A simple to use log system, minimalist but with features for debugging and differentiation of messages
Example
package main
import (
"fmt"
"github.com/structy/log"
)
func main() {
log.Debugln("Debug message")
log.DebugMode = false
log.Debugln("Debug message that will be hidden")
log.Println("Info message")
log.Warningln("Warning message")
log.Errorln("Error message")
log.Fatal("Fatal error message")
fmt.Println("I will never be printed because of Fatal()")
}
# Functions
AddAdapter allows to add an adapter and parameters.
Debugf shows debug message on stdout without line break at the end.
Debugln shows debug message on stdout with line break at the end.
DefaultAdapter of log package.
Errorf shows formatted error message on stdout without line break at the end.
Errorln message with line break at the end.
Fatal show message with line break at the end and exit to OS.
HTTPError write lot to stdout and return json error on http.ResponseWriter with http error code.
Printf shows formatted message on stdout without line break at the end.
Println shows message on stdout with line break at the end.
RemoveAdapter remove the adapter from list.
SetAdapterConfig allows set new adapter parameters.
Warningf shows formatted warning message on stdout without line break at the end.
Warningln shows warning message on stdout with line break at the end.
# 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
No description provided by the author
# Variables
Colors contain color array.
DebugMode Enable debug mode.
EnableANSIColors enables ANSI colors, default true.
MaxLineSize limits the size of the line, if the size exceeds that indicated by MaxLineSize the system cuts the string and adds "..." at the end.
Prefixes of messages.
TimeFormat defines which pattern will be applied for display time in the logs.
# Structs
AdapterPod contains the metadata of an adapter.
# Type aliases
AdapterFunc is the type for the function adapter any function that has this signature can be used as an adapter.
No description provided by the author
No description provided by the author