-
Notifications
You must be signed in to change notification settings - Fork 18
TS-40806 replace the artifical delayed logger with a delayed appender #614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
3abf8b6
ebc6884
6ef19dc
e8cdeea
a53d202
9436f01
9aec90b
b073c2e
80d3b22
d00f793
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package com.teamscale.jacoco.agent.logging; | ||
|
|
||
| import org.jetbrains.annotations.NotNull; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.Iterator; | ||
| import java.util.List; | ||
|
|
||
| /** A Buffer that cn be closed and ignores all inputs once closed. */ | ||
| class CloseableBuffer<T> implements Iterable<T> { | ||
| private final List<T> BUFFER = new ArrayList<>(); | ||
|
Check warning on line 11 in agent/src/main/java/com/teamscale/jacoco/agent/logging/CloseableBuffer.java
|
||
|
|
||
| private boolean closed = false; | ||
|
|
||
| /** Append to the buffer. | ||
| * | ||
| * @return whether the given object was appended to the buffer. Returns {@code false} if the buffer is closed. | ||
| * */ | ||
| public boolean append(T object) { | ||
| if (!closed) { | ||
| return BUFFER.add(object); | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| /** Close the buffer. */ | ||
| public void close() { | ||
| closed = true; | ||
| } | ||
|
|
||
| /** Clear the buffer. */ | ||
| public void clear() { | ||
| BUFFER.clear(); | ||
| } | ||
|
|
||
|
|
||
| @NotNull | ||
| @Override | ||
| public Iterator<T> iterator() { | ||
| return BUFFER.iterator(); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I run the sample-app on master with
logging-config=./tmp/teamscale-jacoco-agent/logging/logback.rolling-file.xmlthe console output ison this branch it is
which I would not have expected as the log output is expected to be written to the file system. Not 100% sure though where those logs are written to the console though.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was caused by the fact that the delayed appender wasn't actually used at all - I think for some reason a console logger was picked up somewhere instead? And I mistook its output for the output of the console appender that was supposed to be used after initializing the correct logger... At least in my current implementation it is not actually used when calling
LOGGER.error(...)🤔 I'm working on it