From fc2c737808ba9f9b493ed75e6bdfbc5800bee9dc Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Wed, 20 Oct 2021 14:01:09 -0400 Subject: [PATCH] Fix the logging example so that it is valid JS --- docs/_advanced/logging.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/_advanced/logging.md b/docs/_advanced/logging.md index 2352ced9b..00e886f96 100644 --- a/docs/_advanced/logging.md +++ b/docs/_advanced/logging.md @@ -6,7 +6,7 @@ order: 8 ---
-By default, Bolt for JavaScript will log information from your app to the console. You can customize how much logging occurs by passing a `logLevel` in the constructor. The available log levels in order of most to least logs are `DEBUG`, `INFO`, `WARN`, and `ERROR`. +By default, Bolt for JavaScript will log information from your app to the console. You can customize how much logging occurs by passing a `logLevel` in the constructor. The available log levels in order of most to least logs are `DEBUG`, `INFO`, `WARN`, and `ERROR`.
```javascript @@ -52,14 +52,15 @@ const app = new App({ signingSecret, // Creating a logger as a literal object. It's more likely that you'd create a class. logger: { - debug(...msgs): { logWritable.write('debug: ' + JSON.stringify(msgs)); }, - info(...msgs): { logWritable.write('info: ' + JSON.stringify(msgs)); }, - warn(...msgs): { logWritable.write('warn: ' + JSON.stringify(msgs)); }, - error(...msgs): { logWritable.write('error: ' + JSON.stringify(msgs)); }, - setLevel(): { }, - setName(): { }, + debug: (...msgs) => { logWritable.write('debug: ' + JSON.stringify(msgs)); }, + info: (...msgs) => { logWritable.write('info: ' + JSON.stringify(msgs)); }, + warn: (...msgs) => { logWritable.write('warn: ' + JSON.stringify(msgs)); }, + error: (...msgs) => { logWritable.write('error: ' + JSON.stringify(msgs)); }, + setLevel: (level) => { }, + getLevel: () => { }, + setName: (name) => { }, }, }); ``` - \ No newline at end of file +