-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added delegate to the logger + improvements (#164)
- Loading branch information
Showing
7 changed files
with
113 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
# Logging | ||
|
||
For logging purposes, WMT uses `WMTLogger` class that prints to the console. | ||
You can set up logging for the library using the `WMTLogger` class. | ||
|
||
<!-- begin box info --> | ||
Note that logging to the console is available only when the library is compiled in the `Debug` mode or with `WMT_ENABLE_LOGGING` Swift compile condition. | ||
Networking traffic is logged in its own logger described in the [networking library documentation](https://github.com/wultra/networking-apple). | ||
<!-- end --> | ||
|
||
### Verbosity Level | ||
|
||
You can limit the amount of logged information via `verboseLevel` property. | ||
You can limit the amount of logged information via the `verboseLevel` property. | ||
|
||
| Level | Description | | ||
| --- | --- | | ||
| `off` | Silences all messages. | | ||
| `errors` | Only errors will be printed to the debug console. | | ||
| `warnings` _(default)_ | Errors and warnings will be printed to the debug console. | | ||
| `all` | All messages will be printed to the debug console. | | ||
| Level | Description | | ||
| ---------------------- | ------------------------------------------------- | | ||
| `off` | Silences all messages. | | ||
| `errors` | Only errors will be logged. | | ||
| `warnings` _(default)_ | Errors and warnings will be logged. | | ||
| `info` | Error, warning and info messages will be logged. | | ||
| `debug` | All messages will be logged. | | ||
|
||
Example configuration: | ||
### Logger Delegate | ||
|
||
```swift | ||
import WultraMobileTokenSDK | ||
|
||
WMTLogger.verboseLevel = .all | ||
``` | ||
In case you want to process logs on your own (for example log into a file or some cloud service), you can set `WMTLogger.delegate`. |