Verified Commit 24757abe authored by Lukas Wiest's avatar Lukas Wiest 🚂
Browse files

refactor(docs): api: core: write 'Logging'

parent d924ead9
# Logging
!!! todo
write usage api docs
The library uses the built-in logger from `java.util.logging`.
It configures to not use the parent logger and places a new ConsoleHandler
on static initialization. This outputs the log in formatted lines like:
```text
[2020-11-27T14:40:26+0100] [WARNING] [de.hftstuttgart.unifiedticketing.core.Logging.test] calling from app
```
This will _not_ change visual presentation based on any localization.
## change log-level
Default is to use _INFO_-level.
You can change the used level:
```java
Logging.setLevel(Level);
```
The parameter passed is of type `java.util.logging.Level`.
## test logging output
To test if the logging as such works,
you can pass a test string:
```java
Logging.test("test message");
```
This message will be logged by the `Logging`-class own Logger,
once per level.
## set custom formatter
If you need another format,
you can replace the default formatter of this lib by calling:
```java
Logging.setFormatter(Formatter);
```
This formatter has to be of type `java.util.logging.Formatter`
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment