Documentation
¶
Overview ¶
Package constants provides application-wide constant values used throughout the logger system. These constants define environment names, configuration keys, and other fixed values to ensure consistency across the codebase.
Index ¶
Constants ¶
const ( // NonProductionEnvironment is the environment name for non-production environments. NonProductionEnvironment = "development" // DefaultTimeout is the default timeout for asynchronous logging. DefaultTimeout = 5 * time.Second )
const ( // TraceHeader is the default HTTP header for trace identifiers. TraceHeader = "X-Trace-ID" // RequestHeader is the default HTTP header for request identifiers. RequestHeader = "X-Request-ID" )
const ( // LogOutputStdout represents the standard output stream. LogOutputStdout OutputType = "stdout" // LogOutputStderr represents the standard error stream. LogOutputStderr OutputType = "stderr" // LogOutputFile represents a file output. LogOutputFile OutputType = "file" // TimeFormatUnix represents the Unix timestamp format. TimeFormatUnix TimeFormat = "unix" // TimeFormatUnixMs represents the Unix timestamp format with milliseconds. TimeFormatUnixMs TimeFormat = "unix_ms" // TimeFormatRFC3339 represents the RFC3339 timestamp format. TimeFormatRFC3339 TimeFormat = "rfc3339" // TimeFormatRFC represents the RFC3339 timestamp format. TimeFormatRFC TimeFormat = "rfc" // TimeFormatDefault represents the default timestamp format. TimeFormatDefault TimeFormat = "default" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationKey ¶
type ApplicationKey struct{}
ApplicationKey is the context key for the application field.
type ComponentKey ¶
type ComponentKey struct{}
ComponentKey is the context key for the component field.
type EnvironmentKey ¶
type EnvironmentKey struct{}
EnvironmentKey is the context key for the environment field.
type NamespaceKey ¶
type NamespaceKey struct{}
NamespaceKey is the context key for the namespace field.
type OutputType ¶
type OutputType string
OutputType represents the type of output.
func (OutputType) IsValid ¶
func (o OutputType) IsValid() bool
IsValid returns true if the given OutputType is a valid output type, and false otherwise.
func (OutputType) String ¶
func (o OutputType) String() string
String returns the string representation of the OutputType.
type TimeFormat ¶
type TimeFormat string
TimeFormat represents the format of time.
func (TimeFormat) IsValid ¶
func (t TimeFormat) IsValid() bool
IsValid returns true if the given TimeFormat is a valid time format, and false otherwise.
func (TimeFormat) String ¶
func (t TimeFormat) String() string
String returns the string representation of the TimeFormat.