Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipOutputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.helpers.FormattingTuple;
import org.slf4j.helpers.MessageFormatter;

public final class ProfilerFlareLogger implements TracerFlare.Reporter {
private static final Logger log = LoggerFactory.getLogger(ProfilerFlareLogger.class);

private static final class Singleton {
private static final ProfilerFlareLogger INSTANCE = new ProfilerFlareLogger();
}
Expand All @@ -36,6 +40,9 @@ public static ProfilerFlareLogger getInstance() {
* @return Returns {@literal true} if the message was stored for flare, {@literal false} otherwise
*/
public boolean log(String msgFormat, Object... args) {
// if something is important enough to store in flare, perhaps logging at WARN level is fine
log.warn(msgFormat, args);

FormattingTuple ft = MessageFormatter.arrayFormat(msgFormat, args);
StringBuilder sb =
new StringBuilder(Instant.now().atZone(ZoneOffset.UTC).toString())
Expand Down
Loading