Skip to content

Commit 63ce2a4

Browse files
committed
Log profiler flare-worthy messages as WARN
1 parent b3c7600 commit 63ce2a4

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

internal-api/src/main/java/datadog/trace/api/profiling/ProfilerFlareLogger.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77
import java.util.ArrayList;
88
import java.util.List;
99
import java.util.zip.ZipOutputStream;
10+
import org.slf4j.Logger;
11+
import org.slf4j.LoggerFactory;
1012
import org.slf4j.helpers.FormattingTuple;
1113
import org.slf4j.helpers.MessageFormatter;
1214

1315
public final class ProfilerFlareLogger implements TracerFlare.Reporter {
16+
private static final Logger log = LoggerFactory.getLogger(ProfilerFlareLogger.class);
17+
1418
private static final class Singleton {
1519
private static final ProfilerFlareLogger INSTANCE = new ProfilerFlareLogger();
1620
}
@@ -36,6 +40,9 @@ public static ProfilerFlareLogger getInstance() {
3640
* @return Returns {@literal true} if the message was stored for flare, {@literal false} otherwise
3741
*/
3842
public boolean log(String msgFormat, Object... args) {
43+
// if something is important enough to store in flare, perhaps logging at WARN level is fine
44+
log.warn(msgFormat, args);
45+
3946
FormattingTuple ft = MessageFormatter.arrayFormat(msgFormat, args);
4047
StringBuilder sb =
4148
new StringBuilder(Instant.now().atZone(ZoneOffset.UTC).toString())

0 commit comments

Comments
 (0)