From aea36716c00b1d7a9ddcc1de8b1c70f9bba309db Mon Sep 17 00:00:00 2001 From: jonaszmclaren Date: Tue, 15 Aug 2017 12:52:05 +0200 Subject: [PATCH] Update droplet.md Fix AllCapsLogger creation to compile. --- 2.0/docs/vapor/droplet.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)