Skip to content

Commit

Permalink
taking @shanedewael's suggestions on docs edits
Browse files Browse the repository at this point in the history
  • Loading branch information
aoberoi committed Feb 15, 2019
1 parent f434f68 commit b2701f9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions docs/_pages/rtm_client.md
Expand Up @@ -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.
Expand All @@ -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:

Expand All @@ -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');
Expand Down
12 changes: 8 additions & 4 deletions docs/_pages/web_client.md
Expand Up @@ -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.
Expand All @@ -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:

Expand All @@ -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');
Expand Down

0 comments on commit b2701f9

Please sign in to comment.