diff --git a/2.0/docs/vapor/droplet.md b/2.0/docs/vapor/droplet.md index bc51bcc8..8c5b77d5 100644 --- a/2.0/docs/vapor/droplet.md +++ b/2.0/docs/vapor/droplet.md @@ -123,6 +123,12 @@ final class AllCapsLogger: LogProtocol { print(message.uppercased() + "!!!") } } + +extension AllCapsLogger: ConfigInitializable { + public convenience init(config: Config) throws { + self.init() + } +} ``` Now add the logger to the Droplet using the `addConfigurable` method for logs. @@ -130,7 +136,7 @@ Now add the logger to the Droplet using the `addConfigurable` method for logs. `main.swift` ```swift let config = try Config() -config.addConfigurable(log: AllCapsLogger(), name: "all-caps") +config.addConfigurable(log: AllCapsLogger.init, name: "all-caps") let drop = try Droplet(config)