-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
195 additions
and
205 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
# Logging | ||
|
||
For logging purposes, WMT uses the `Logger` class inside the `com.wultra.android.mtokensdk.common` package that prints to the console. | ||
The library is intensively logging into the console via `WMTLogger`. | ||
|
||
<!-- begin box warning --> | ||
Note that `Logger` is internally using `android.util.Log` class with verbosity ERROR, WARNING, and DEBUG and is subjected to its internal logic. | ||
<!-- begin box info --> | ||
`WMTLogger` calls internally the `android.util.Log` class. | ||
<!-- end --> | ||
|
||
### Verbosity Level | ||
|
||
You can limit the amount of logged information via the `verboseLevel` static property. | ||
|
||
| Level | Description | | ||
| --- | --- | | ||
| `OFF` | Silences all messages. | | ||
| `ERROR` | Only errors will be printed to the console. | | ||
| Level | Description | | ||
|-----------------------|-----------------------------------------------------| | ||
| `OFF` | Silences all messages. | | ||
| `ERROR` | Only errors will be printed to the console. | | ||
| `WARNING` _(default)_ | Errors and warnings will be printed to the console. | | ||
| `DEBUG` | All messages will be printed to the console. | | ||
| `DEBUG` | All messages will be printed to the console. | | ||
|
||
Example configuration: | ||
|
||
```kotlin | ||
import com.wultra.android.mtokensdk.common.Logger | ||
### Networking Logs | ||
|
||
Logger.verboseLevel = Logger.VerboseLevel.DEBUG | ||
``` | ||
Networking logs are managed by the [networking library and it's logger](https://github.com/wultra/networking-android) | ||
|
||
### Networking Logs | ||
### Log Listener | ||
|
||
All requests and responses are logged in the `DEBUG` level. | ||
The `WMTLogger` class offers a static `logListener` property. If you provide a listener, all logs will also be passed to it (the library always logs into the Android default log). | ||
|
||
<!-- begin box warning --> | ||
In case you provided your own OkHttp instance, you need to set up your own logging for monitoring the traffic via the OkHttp interceptors. | ||
<!-- begin box info --> | ||
Log listener comes in handy when you want to log into a file or some online service. | ||
<!-- end --> |
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
142 changes: 0 additions & 142 deletions
142
library/src/main/java/com/wultra/android/mtokensdk/common/Logger.kt
This file was deleted.
Oops, something went wrong.
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
35 changes: 35 additions & 0 deletions
35
library/src/main/java/com/wultra/android/mtokensdk/log/WMTLogListener.kt
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2024, Wultra s.r.o. (www.wultra.com). | ||
* | ||
* All rights reserved. This source code can be used only for purposes specified | ||
* by the given license contract signed by the rightful deputy of Wultra s.r.o. | ||
* This source code can be used only by the owner of the license. | ||
* | ||
* Any disputes arising in respect of this agreement (license) shall be brought | ||
* before the Municipal Court of Prague. | ||
*/ | ||
|
||
package com.wultra.android.mtokensdk.log | ||
|
||
/** Log listener receives logs from the library logger for further processing. */ | ||
interface WMTLogListener { | ||
/** | ||
* If the listener should follow selected verbosity level. | ||
* | ||
* When set to true, then (for example) if [WMTLogger.VerboseLevel.ERROR] is selected as a [WMTLogger.verboseLevel], only [error] methods will be called. | ||
* When set to false, all methods might be called no matter the selected [WMTLogger.verboseLevel]. | ||
*/ | ||
val followVerboseLevel: Boolean | ||
|
||
/** Error log */ | ||
fun error(message: String) | ||
|
||
/** Warning log */ | ||
fun warning(message: String) | ||
|
||
/** Info log */ | ||
fun info(message: String) | ||
|
||
/** Debug log */ | ||
fun debug(message: String) | ||
} |
Oops, something went wrong.