package promslog
import "github.com/prometheus/common/promslog"
Index ¶
- Variables
- func New(config *Config) *slog.Logger
- type AllowedFormat
- type AllowedLevel
- func (l *AllowedLevel) Set(s string) error
- func (l *AllowedLevel) String() string
- func (l *AllowedLevel) UnmarshalYAML(unmarshal func(interface{}) error) error
- type Config
- type LogStyle
Variables ¶
var ( LevelFlagOptions = []string{"debug", "info", "warn", "error"} FormatFlagOptions = []string{"logfmt", "json"} )
Functions ¶
func New ¶
New returns a new slog.Logger. Each logged line will be annotated with a timestamp. The output always goes to stderr.
Types ¶
type AllowedFormat ¶
type AllowedFormat struct {
// contains filtered or unexported fields
}
AllowedFormat is a settable identifier for the output format that the logger can have.
func (*AllowedFormat) Set ¶
func (f *AllowedFormat) Set(s string) error
Set updates the value of the allowed format.
func (*AllowedFormat) String ¶
func (f *AllowedFormat) String() string
type AllowedLevel ¶
type AllowedLevel struct {
// contains filtered or unexported fields
}
AllowedLevel is a settable identifier for the minimum level a log entry must be have.
func (*AllowedLevel) Set ¶
func (l *AllowedLevel) Set(s string) error
Set updates the value of the allowed level.
func (*AllowedLevel) String ¶
func (l *AllowedLevel) String() string
func (*AllowedLevel) UnmarshalYAML ¶
func (l *AllowedLevel) UnmarshalYAML(unmarshal func(interface{}) error) error
type Config ¶
type Config struct { Level *AllowedLevel Format *AllowedFormat Style LogStyle // contains filtered or unexported fields }
Config is a struct containing configurable settings for the logger
type LogStyle ¶
type LogStyle string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
promslog/flag |
- Version
- v0.58.0
- Published
- Sep 3, 2024
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 2 hours ago –
Tools for package owners.