Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Lukas Wiest
unified-ticketing
Commits
24757abe
Verified
Commit
24757abe
authored
Nov 27, 2020
by
Lukas Wiest
🚂
Browse files
refactor(docs): api: core: write 'Logging'
parent
d924ead9
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/api/core/logging.md
View file @
24757abe
# 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`
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment