Skip to content

Commit

Permalink
Add docs for logger (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
devleejb authored Jan 30, 2024
1 parent 920e3e5 commit 1205c63
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/js-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,30 @@ doc.update((root, presence) => {
});
```

### Logger Options

The Logger outputs events occurring within the SDK to the console for debugging purposes. To modify these options, you can use the `setLogLevel` function.

```typescript
import { setLogLevel, LogLevel } from 'yorkie-js-sdk';

setLogLevel(LogLevel.Error); // Display logs with Error or higher
```

The available log levels for `setLogLevel` are:

| LogLevel | Description |
|----------|---------------------------------|
| `LogLevel.Trivial` | Lowest level of verbosity |
| `LogLevel.Debug` | Debugging information |
| `LogLevel.Info` | General information |
| `LogLevel.Warn` | Warnings and potential issues |
| `LogLevel.Error` | Errors and unexpected behavior |
| `LogLevel.Fatal` | Critical errors, may lead to termination |

Adjust the log level for flexible control over log verbosity in your application.


### Reference

For details on how to use the JS SDK, please refer to [JS SDK Reference](https://yorkie.dev/yorkie-js-sdk/api-reference/).

0 comments on commit 1205c63

Please sign in to comment.