Documentation ¶
Overview ¶
Though Go has a logging package in its standard library this package is rather basic. IMHO this is the reason why there are several additional and different logging libraries in the Go community which lead to some irritation when one wants to write an application that ends up with having several different logging frameworks included due to package dependencies.
This package does not address the desire to have one unified logger or at least a unified logging interface. – Let the packages choose their loggers… for good or for bad. However, what I want to be able to do is configure all those loggers in my application in a unified way! At least configure some common things that one often wants to configure:
- Switching loggers for some “topics” on and off
- Setting the log level of loggers
- (may be other things to come in the future)
Note that the first bullet in the list gives the hint that loggers shall be hierarchically grouped so that configuration becomes simpler.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FeatureType ¶ added in v0.14.0
Example ¶
fmt.Println(FeatureType(Enable(false))) fmt.Println(FeatureType(InfoLevel)) fmt.Println(FeatureType(Output{os.Stderr})) fmt.Println(FeatureType(SrcFile))
Output: git.fractalqb.de/fractalqb/c4hgol.Enable git.fractalqb.de/fractalqb/c4hgol.Level git.fractalqb.de/fractalqb/c4hgol.Output git.fractalqb.de/fractalqb/c4hgol.Source
Types ¶
type Group ¶ added in v0.10.0
type Group struct { Named // contains filtered or unexported fields }
func MustNewGroup ¶ added in v0.14.0
func MustNewLogGroup ¶ added in v0.14.0
func NewLogGroup ¶ added in v0.13.0
type LevelMap ¶
type LevelMap struct {
// contains filtered or unexported fields
}
func MustNewLevelMap ¶ added in v0.14.0
func NewLevelMap ¶ added in v0.14.0
type Named ¶ added in v0.14.0
type Named struct {
// contains filtered or unexported fields
}
func MustNewNamed ¶ added in v0.14.0
type Unsupported ¶ added in v0.14.0
type Unsupported struct {
Feature any
}
func (Unsupported) Error ¶ added in v0.14.0
func (u Unsupported) Error() string
func (Unsupported) Is ¶ added in v0.14.0
func (u Unsupported) Is(err error) bool