diff options
Diffstat (limited to 'plugins/logger/plugin.go')
-rw-r--r-- | plugins/logger/plugin.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/logger/plugin.go b/plugins/logger/plugin.go index 250127b0..719770c0 100644 --- a/plugins/logger/plugin.go +++ b/plugins/logger/plugin.go @@ -13,13 +13,17 @@ const PluginName = "logs" // ZapLogger manages zap logger. type ZapLogger struct { base *zap.Logger - cfg Config + cfg *Config channels ChannelConfig } // Init logger service. func (z *ZapLogger) Init(cfg config.Configurer) error { - const op = errors.Op("zap logger init") + const op = errors.Op("config_plugin_init") + if !cfg.Has(PluginName) { + return errors.E(op, errors.Disabled) + } + err := cfg.UnmarshalKey(PluginName, &z.cfg) if err != nil { return errors.E(op, errors.Disabled, err) |