Skip to content

Commit

Permalink
Merge pull request #1600 from klues/patch-1
Browse files Browse the repository at this point in the history
updated docs about logger
  • Loading branch information
pamapa authored Aug 20, 2024
2 parents c652d48 + 4043bc4 commit ce324b0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,19 @@ The [User](classes/User.html) type is returned from the [UserManager](classes/Us


# Logging
The oidc-client-ts library supports logging. You can set a logger by assigning `Oidc.Log.logger` to anything that supports a `info`, `warn`, and `error` methods that accept a params array. By default, no logger is configured.
The oidc-client-ts library supports logging. You can set a logger to anything that supports a `info`, `warn`, and `error` methods that accept a params array by calling `Log.setLogger()`. By default, no logger is configured.

The `console` object in the browser supports these, so a common way to easily
enable logging in the browser is to simply add this code:

```javascript
Oidc.Log.setLogger(console);
import { Log } from 'oidc-client-ts';
Log.setLogger(console);
```

Also, logging has levels so you can control the verbosity by calling
`Oidc.Log.setLevel()` with one of `Oidc.Log.NONE`, `Oidc.Log.ERROR`,
`Oidc.Log.WARN`, or `Oidc.Log.INFO`. The default is `Oidc.Log.INFO`.
`Log.setLevel()` with one of `Log.NONE`, `Log.ERROR`,
`Log.WARN`, or `Log.INFO`. The default is `Log.INFO`.

# Provider specific settings
Additional provider specific settings may be needed for a flawless operation:
Expand Down

0 comments on commit ce324b0

Please sign in to comment.