Documentation
¶
Index ¶
- Constants
- Variables
- func Configure(config *logcfg.Config, extra ...string) error
- func ConfigureGlobal(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 Logger(messageContext ...logging.MessageContext) logging.Logger
- func NewBufferedContext() (logging.Context, *bytes.Buffer)
- func NewDefaultContext() 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 ¶
ConfigureGlobal applies configuration for the default global log context provided by this package.
func DynamicLogger ¶
func DynamicLogger(messageContext ...logging.MessageContext) logging.UnboundLogger
DynamicLogger gets an unbound logger based on the default library logging context.
func ErrorMessage ¶
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 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 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) *StaticContext