loggo

package module
v0.0.0-...-48c056d Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 5 Imported by: 1

README

loggo

a simple log module written in golang.

go get git.velvettear.de/velvettear/loggo

Documentation

Index

Constants

View Source
const PLACEHOLDER_EXTRAS = "$EXTRAS$"

extras placeholder

View Source
const PLACEHOLDER_LOGLEVEL = "$LOGLEVEL$"

log level placeholder

View Source
const PLACEHOLDER_MESSAGE = "$MESSAGE$"

message placeholder

View Source
const PLACEHOLDER_TIMEDIFF = "$TIMEDIFF$"

time difference placeholder

View Source
const PLACEHOLDER_TIMESTAMP = "$TIMESTAMP$"

timestamp placeholder

Variables

View Source
var DebugLevel = logLevel{0, "debug", *color.New(color.FgCyan)}

debug log level (level = 0, name = "debug")

View Source
var ErrorLevel = logLevel{3, "error", *color.New(color.FgRed)}

error log level (level = 3, name = "error")

View Source
var FatalLevel = logLevel{4, "fatal", *color.New(color.FgRed).Add(color.Bold)}

fatal log level (level = 4, name = "fatal")

View Source
var InfoLevel = logLevel{1, "info", *color.New(color.FgGreen)}

info log level (level = 1, name = "info")

View Source
var WarningLevel = logLevel{2, "warning", *color.New(color.FgYellow)}

warning log level (level = 2, name = "warning")

Functions

func Debug

func Debug(message string, extras ...string)

debug logging without time difference calculation

func DebugTimed

func DebugTimed(message string, timestamp int64, extras ...string)

debug logging with time difference calculation

func Error

func Error(message string, extras ...string)

error logging without time difference calculation

func ErrorTimed

func ErrorTimed(message string, timestamp int64, extras ...string)

error logging with time difference calculation

func Fatal

func Fatal(message string, extras ...string)

fatal logging without time difference calculation

func FatalTimed

func FatalTimed(message string, timestamp int64, extras ...string)

fatal logging with time difference calculation

func GetDateFormat

func GetDateFormat() string

get current date format

func GetExtrasFormat

func GetExtrasFormat() string

get current extras format

func GetExtrasSeparator

func GetExtrasSeparator() string

get current extras separator

func GetLogFormat

func GetLogFormat() string

get current log format

func GetLogLevel

func GetLogLevel() logLevel

return current set log level

func GetTimediffFormat

func GetTimediffFormat() string

get current time diff format

func Info

func Info(message string, extras ...string)

info logging without time difference calculation

func InfoTimed

func InfoTimed(message string, timestamp int64, extras ...string)

info logging with time difference calculation

func SetDateFormat

func SetDateFormat(format string)

set current date format

func SetExtrasFormat

func SetExtrasFormat(format string)

set current extras format

func SetExtrasSeparator

func SetExtrasSeparator(separator string)

set current extras separator

func SetLogFormat

func SetLogFormat(format string)

set current prefix format

func SetLogLevel

func SetLogLevel(level logLevel)

set current log level

func SetLogLevelByLevel

func SetLogLevelByLevel(level int)

set current log level by level

func SetLogLevelByName

func SetLogLevelByName(name string)

set current log level by name

func SetTimediffFormat

func SetTimediffFormat(format string)

set current time diff format

func Warning

func Warning(message string, extras ...string)

warning logging without time difference calculation

func WarningTimed

func WarningTimed(message string, timestamp int64, extras ...string)

warning logging with time difference calculation

Types

This section is empty.

Jump to

Keyboard shortcuts

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