Skip to content

Commit 850b8ab

Browse files
committed
HADOOP-18808. LogExactlyOnce to add a debug() method (apache#5850)
Contributed by Steve Loughran
1 parent adab0ba commit 850b8ab

File tree

1 file changed

+11
-0
lines changed
  • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/store

1 file changed

+11
-0
lines changed

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/store/LogExactlyOnce.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,15 @@ public void error(String format, Object...args) {
4949
log.error(format, args);
5050
}
5151
}
52+
53+
/**
54+
* Log at DEBUG if nothing has been logged yet.
55+
* @param format format string
56+
* @param args arguments
57+
*/
58+
public void debug(String format, Object...args) {
59+
if (!logged.getAndSet(true)) {
60+
log.debug(format, args);
61+
}
62+
}
5263
}

0 commit comments

Comments
 (0)