Closed YoEight closed 2 years ago
Fixes #117
The designed solution is based upon the LoggingFunc callback.
LoggingFunc
type LoggingFunc = func(scope string, format string, args ...interface{})
By default, the library provides two implementations: esdb.ConsoleLogging() (enabled by default) and esdb.NoopLogging() (logs nothing).
esdb.ConsoleLogging()
esdb.NoopLogging()
Users can plug their own implementation by setting esdb.Configuration 's Logger property:
esdb.Configuration
Logger
conf, err := esdb.ParseConnectionString("{connectionString}") if err != nil { panic(err) } conf.Logger = myLoggingImpl() db, err := esdb.NewClient(conf) ...
Fixes #117
The designed solution is based upon the
LoggingFunc
callback.By default, the library provides two implementations:
esdb.ConsoleLogging()
(enabled by default) andesdb.NoopLogging()
(logs nothing).Users can plug their own implementation by setting
esdb.Configuration
'sLogger
property: