From b2701f916658284893d9760c064945b697796778 Mon Sep 17 00:00:00 2001 From: Ankur Oberoi Date: Fri, 15 Feb 2019 14:30:18 -0800 Subject: [PATCH] taking @shanedewael's suggestions on docs edits --- docs/_pages/rtm_client.md | 12 ++++++++---- docs/_pages/web_client.md | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/_pages/rtm_client.md b/docs/_pages/rtm_client.md index 71e0908d2..dcaa501f8 100644 --- a/docs/_pages/rtm_client.md +++ b/docs/_pages/rtm_client.md @@ -301,8 +301,8 @@ you need from the Web API whenever you need it. ### Customizing the logger -The `RTMClient` also logs interesting events as it operates. By default, the log level is set to `info` and it should -not log anything as long as nothing goes wrong. +The `RTMClient` also logs interesting events as it operates. By default, the log level is set to `LogLevel.INFO` and it +should not log anything as long as nothing goes wrong. You can adjust the log level by setting the `logLevel` option to any of the values found in the `LogLevel` top-level export. @@ -315,6 +315,10 @@ const { RTMClient, LogLevel } = require('@slack/client'); const rtm = new RTMClient(token, { logLevel: LogLevel.DEBUG }); ``` +There are four logging levels: `LogLevel.DEBUG`, `LogLevel.INFO`, `LogLevel.WARN`, `LogLevel.ERROR`. Here they appear in +order of increasing severity, which means that using `LogLevel.ERROR` will output the least number of messages, and only +the most important. + You can also capture the logs without writing them to stdout by setting the `logger` option. The option should be set to an object that has the following methods: @@ -330,8 +334,8 @@ to an object that has the following methods: | `error()` | `...msgs: any[]` | `void` | -**NOTE**: The option can also take a function with the following signature, but this usage is deprecated: -`fn(level: string, message: string)`. +**NOTE**: While the use of logging functions is deprecated, the `logger` option will still currently accept a function +whose method signature matches `fn(level: string, message: string)` ```javascript const fs = require('fs'); diff --git a/docs/_pages/web_client.md b/docs/_pages/web_client.md index 530749d4d..317a2744a 100644 --- a/docs/_pages/web_client.md +++ b/docs/_pages/web_client.md @@ -420,8 +420,8 @@ failing with `Error`s which have a `code` property set to `errorCode.HTTPError`. ### Customizing the logger -The `WebClient` also logs interesting events as it operates. By default, the log level is set to `info` and it should -not log anything as long as nothing goes wrong. +The `WebClient` also logs interesting events as it operates. By default, the log level is set to `LogLevel.INFO` and it +should not log anything as long as nothing goes wrong. You can adjust the log level by setting the `logLevel` option to any of the values found in the `LogLevel` top-level export. @@ -434,6 +434,10 @@ const { WebClient, LogLevel } = require('@slack/client'); const web = new WebClient(token, { logLevel: LogLevel.DEBUG }); ``` +There are four logging levels: `LogLevel.DEBUG`, `LogLevel.INFO`, `LogLevel.WARN`, `LogLevel.ERROR`. Here they appear in +order of increasing severity, which means that using `LogLevel.ERROR` will output the least number of messages, and only +the most important. + You can also capture the logs without writing them to stdout by setting the `logger` option. The option should be set to an object that has the following methods: @@ -449,8 +453,8 @@ to an object that has the following methods: | `error()` | `...msgs: any[]` | `void` | -**NOTE**: The option can also take a function with the following signature, but this usage is deprecated: -`fn(level: string, message: string)`. +**NOTE**: While the use of logging functions is deprecated, the `logger` option will still currently accept a function +whose method signature matches `fn(level: string, message: string)`. ```javascript const fs = require('fs');