LogContext

protected void LogContext(Level level, boolean isForced)

Creates a logging context with the specified level, and with a timestamp obtained from the configured logging Platform.

Parameters

level

the log level for this log statement.

isForced

whether to force this log statement (see wasForced for details).


protected void LogContext(Level level, boolean isForced, long timestampNanos)

Creates a logging context with the specified level and timestamp. This constructor is provided only for testing when timestamps need to be injected. In general, subclasses would only need to call this constructor when testing additional API methods which require timestamps (e.g. additional rate limiting functionality). Most unit tests for logger subclasses should not test the value of the timestamp at all, since this is already well tested elsewhere.

Parameters

level

the log level for this log statement.

isForced

whether to force this log statement (see wasForced for details).

timestampNanos

the nanosecond timestamp for this log statement.