Documentation
¶
Overview ¶
Package idlog provides structured JSON logging with readable stack traces. Designed for Yandex Cloud Logging and standard-library-only environments.
Index ¶
Constants ¶
View Source
const ( LevelDebug = "DEBUG" LevelInfo = "INFO" LevelWarn = "WARN" LevelError = "ERROR" LevelFatal = "FATAL" )
Variables ¶
View Source
var StreamName = "app"
StreamName is the name of the log stream. Must be 1–63 characters. Set it once at application startup.
Functions ¶
func AddTrace ¶ added in v1.1.0
AddTrace adds a human-readable function-only stack trace to an error.
func Debug ¶
Debug logs a DEBUG message only if enabled is true.
func Error ¶ added in v1.0.1
func Error(err error)
Error logs an ERROR message without a function-only stack trace. Use AddTrace function to add a trace manually if needed.
func Fail ¶
func Fail(err error)
Fail logs a FATAL error with a function-only stack trace and exits the program.
Types ¶
This section is empty.
Source Files
¶
- idlog.go
Click to show internal directories.
Click to hide internal directories.