Documentation ¶
Index ¶
- Constants
- Variables
- func Configure(config *logcfg.Config, extra ...string) error
- func ConfigureGlobal(config *logcfg.Config, extra ...string) error
- func ConfigureOCM(config *logcfg.Config, extra ...string) error
- func DefineSubRealm(desc string, names ...string) logging.Realm
- func DynamicLogger(messageContext ...logging.MessageContext) logging.UnboundLogger
- func ErrorMessage(err error) *string
- func LogContext(ctx logging.Context, provider logging.ContextProvider) logging.Context
- func Logger(messageContext ...logging.MessageContext) logging.Logger
- func NewBufferedContext() (logging.Context, *bytes.Buffer)
- func NewDefaultContext() logging.Context
- func PopContext()
- func PushContext(ctx logging.Context)
- func SetContext(ctx logging.Context)
- func SubRealm(names ...string) logging.Realm
- type LogProvider
- type StaticContext
Constants ¶
const ( ATTR_HOST = "host" ATTR_USER = "user" ATTR_PATH = "path" ATTR_NAMESPACE = "namespace" )
standard logging value attribute names used in this library.
Variables ¶
var REALM = logging.DefineRealm("ocm", "general realm used for the ocm go library.")
REALM is used to tag all logging done by this library with the ocm tag. This is also used as message context to configure settings for all log output provided by this library.
Functions ¶
func Configure ¶
Configure applies configuration for the default log context provided by this package.
func ConfigureGlobal ¶ added in v0.3.0
ConfigureGlobal applies configuration for the default global log context provided by this package.
func ConfigureOCM ¶ added in v0.12.0
ConfigureOCM applies configuration for the default global ocm log context provided by this package.
func DefineSubRealm ¶ added in v0.3.0
func DynamicLogger ¶ added in v0.3.0
func DynamicLogger(messageContext ...logging.MessageContext) logging.UnboundLogger
DynamicLogger gets an unbound logger based on the default library logging context.
func ErrorMessage ¶
func LogContext ¶ added in v0.8.0
func Logger ¶
func Logger(messageContext ...logging.MessageContext) logging.Logger
Logger determines a default logger for this given message context based on the rule settings for this library.
func NewDefaultContext ¶
func PopContext ¶ added in v0.9.0
func PopContext()
func PushContext ¶ added in v0.9.0
func SetContext ¶
SetContext sets a new preconfigured context. This function should be called prior to any configuration to avoid loosing them.
Types ¶
type LogProvider ¶
type LogProvider interface { logging.ContextProvider logging.AttributionContextProvider Logger(messageContext ...logging.MessageContext) logging.Logger }
type StaticContext ¶
func Context ¶
func Context() *StaticContext
Context returns the default logging configuration used for this library.
func NewContext ¶
func NewContext(ctx logging.Context, global ...bool) *StaticContext