Package io.spine.logging.flogger.util
Class RecursionDepth
- java.lang.Object
-
- io.spine.logging.flogger.util.RecursionDepth
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class RecursionDepth extends Object implements Closeable
A threal local counter, incremented whenever a log statement is being processed by the backend. If this value is greater than 1, then reentrant logging has occured, and some code may behave differently to try and avoid issues such as unbounded recursion. Logging may even be disabled completely if the depth gets too high.This class is an internal detail and must not be used outside the core Flogger library. Backends which need to know the recursion depth for any reason should call
Platform.getCurrentRecursionDepth().- See Also:
- Original Java code of Google Flogger
-
-
Constructor Summary
Constructors Constructor Description RecursionDepth()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static RecursionDepthenterLogStatement()Internal API for use by core Flogger library.static intgetCurrentDepth()Do not call this method directly, usePlatform.getCurrentRecursionDepth().intgetValue()Do not call this method directly, usePlatform.getCurrentRecursionDepth().
-
-
-
Method Detail
-
getCurrentDepth
public static int getCurrentDepth()
Do not call this method directly, usePlatform.getCurrentRecursionDepth().
-
getValue
public int getValue()
Do not call this method directly, usePlatform.getCurrentRecursionDepth().
-
enterLogStatement
public static RecursionDepth enterLogStatement()
Internal API for use by core Flogger library.
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-