package
0.2.0
Repository: https://github.com/mdanialr/api-pkg-go.git
Documentation: pkg.go.dev

# Functions

Any constructs a Log with the given key and value.
Bool constructs a Log with the given key and value.
Error constructs a Log with the given err value and 'error' as the key.
Float constructs a Log with the given key and value.
FromCtx return the singleton Logger associated with given ctx.
NewConfig return new Config after applying given options.
NewConsoleWriter return Writer implementer that write logs to os.Stdout and set given lvl as the log Level.
NewFileWriter return Writer implementer that write logs to designated file based on the given Config.File and set given lvl as the log Level.
NewNewrelicWriter return Writer implementer that ingest logs directly to newrelic server by given Config.NR and set given Level as the log level.
NewNop returns a no-op Logger.
NewObserverWriter return new Writer implementer that write logs to memory and also return ObservedLog to help assert and check logged Log(s).
NewSlogLogger return Logger implementer that use stdlib slog as the backend.
NewZapLogger return Logger implementer that use zap as the backend.
Num constructs a Log with the given key and value.
ParseLevel parses a level based on the lower-case representation of the log level.
String constructs a Log with the given key and value.
WithCtx return a copy of ctx with given logger attached.
WithFileAge set maximum number of days to retain old log files based on the timestamp encoded in their filename.
WithFileMaxBackup set maximum number of old log files to retain before got removed.
WithFilePath set target readable directory + local file which the log data will be written.
WithFileSize set maximum file log size in megabytes before got rotated.
WithNRAppName set new relic application name.
WithNRLicense set new relic license.

# Constants

AnyType use field any interface of Log as the value.
BoolType use field b bool of Log as the value.
CONSOLE target log output to console/terminal.
DebugLevel most verbose logs, and are usually disabled in production.
ErrorLevel logs are high-priority.
ErrorType use field err from error interface of Log as the value.
FILE target log output to local file.
FloatType use field flt float64 of Log as the value.
InfoLevel is the default logging priority.
NEWRELIC target log output directly to new relic via their client sdk.
NumType use field num int of Log as the value.
StringType use field str string of Log as the value.
WarnLevel logs are more important than Info, but don't need individual human review.

# Structs

No description provided by the author
No description provided by the author
Log object that holds data for each field inserted to each log message.
No description provided by the author
ObservedLog is a concurrency-safe, ordered collection of observed Log(s).

# Interfaces

Logger unified front-end to log.
Writer unified log writer that's responsible where the log from Logger should be written to.

# Type aliases

No description provided by the author
A Level is a logging priority.
Output define currently supported target output for logging.
Type indicates how the Logger implementer should treat each Log.