| Package | Description |
|---|---|
| org.spf4j.base | |
| org.spf4j.log | |
| org.spf4j.test.log |
spf4j test log backend for slf4j.
|
| org.spf4j.test.matchers |
| Modifier and Type | Method and Description |
|---|---|
default Level |
ExecutionContext.getBackendMinLogLevel() |
Level |
ExecutionContext.getBackendMinLogLevel(String loggerName)
The minimum log level overwrite.
|
Level |
BasicExecutionContext.getBackendMinLogLevel(String loggerName)
Overwrite for more configurable implementation.
|
default Level |
ExecutionContext.getContextMinLogLevel() |
Level |
ExecutionContext.getContextMinLogLevel(String loggerName)
The minimum log level accepted by this execution context;
The logs that we will store in this context.
|
Level |
BasicExecutionContext.getContextMinLogLevel(String loggerName)
Overwrite for more configurable implementation.
|
default Level |
ExecutionContext.setBackendMinLogLevel(Level level) |
Level |
ExecutionContext.setBackendMinLogLevel(String loggerName,
Level level) |
Level |
BasicExecutionContext.setBackendMinLogLevel(String loggerName,
Level level)
Overwrite for more configurable implementation.
|
| Modifier and Type | Method and Description |
|---|---|
default Level |
ExecutionContext.setBackendMinLogLevel(Level level) |
Level |
ExecutionContext.setBackendMinLogLevel(String loggerName,
Level level) |
Level |
BasicExecutionContext.setBackendMinLogLevel(String loggerName,
Level level)
Overwrite for more configurable implementation.
|
| Modifier and Type | Method and Description |
|---|---|
static Level |
Level.fromAvroLevel(org.spf4j.base.avro.LogLevel level) |
static Level |
Level.fromJulLevel(int severity) |
Level |
AvroLogRecordImpl.getLevel() |
Level |
Slf4jLogRecordImpl.getLevel() |
Level |
Slf4jLogRecord.getLevel() |
static Level |
Level.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Level[] |
Level.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
| Modifier and Type | Method and Description |
|---|---|
static LogAttribute<Level> |
LogAttribute.origLevel(Level level) |
static LogAttribute<Level> |
LogAttribute.origLoggerName(String loggerName) |
static LogAttribute<Level> |
LogAttribute.origTimeStamp(Instant instant) |
static LogAttribute<Level> |
LogAttribute.origTimeStamp(long millisSinceEpoch) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
SLf4jXLogAdapter.isEnabled(Level level,
org.slf4j.Marker marker) |
boolean |
XLog.isEnabled(Level level,
org.slf4j.Marker marker)
Is logger enabled for level and marker
|
boolean |
ExecContextLogger.isEnabled(Level level,
org.slf4j.Marker marker) |
void |
ExecContextLogger.log(ExecutionContext ctx,
Level level,
org.spf4j.base.avro.LogRecord log) |
void |
ExecContextLogger.log(ExecutionContext ctx,
org.slf4j.Marker marker,
Level level,
String msg,
Object... args) |
void |
SLf4jXLogAdapter.log(org.slf4j.Marker marker,
Level level,
String format,
Object... args) |
void |
XLog.log(org.slf4j.Marker marker,
Level level,
String format,
Object... args)
Log.
|
void |
ExecContextLogger.log(org.slf4j.Marker marker,
Level level,
String msg,
Object... args) |
static void |
LogUtils.logUpgrade(Logger log,
Level plevel,
String format,
Object... pargs) |
static void |
LogUtils.logUpgrade(org.slf4j.Logger log,
org.slf4j.Marker marker,
Level level,
String format,
Object... pargs) |
void |
SLf4jXLogAdapter.logUpgrade(org.slf4j.Marker marker,
Level level,
String format,
Object... pargs) |
void |
XLog.logUpgrade(org.slf4j.Marker marker,
Level level,
String format,
Object... args)
Log with a level that is enabled.
|
static LogAttribute<Level> |
LogAttribute.origLevel(Level level) |
| Constructor and Description |
|---|
Slf4jLogRecordImpl(boolean isLogged,
String logger,
Level level,
org.slf4j.Marker marker,
long timestampMillis,
String format,
Object... arguments) |
Slf4jLogRecordImpl(boolean isLogged,
String logger,
Level level,
org.slf4j.Marker marker,
String format,
Object... arguments) |
Slf4jLogRecordImpl(String logger,
Level level,
org.slf4j.Marker marker,
String format,
Object... arguments) |
Slf4jLogRecordImpl(String logger,
Level level,
String format,
Object... arguments) |
| Modifier and Type | Method and Description |
|---|---|
Level |
PrintConfig.getMinLevel() |
default Level |
LogConfig.minRootLevel() |
| Modifier and Type | Method and Description |
|---|---|
LogCollection<ArrayDeque<TestLogRecord>> |
TestLoggers.collect(Level minimumLogLevel,
int maxNrLogs,
boolean collectPrinted)
Collect up to a number of log messages.
|
LogCollection<ArrayDeque<TestLogRecord>> |
TestLoggers.collect(Level minimumLogLevel,
int maxNrLogs,
boolean collectPrinted,
String include,
String... excludeCategories) |
<T> LogCollection<T> |
TestLoggers.collect(String category,
Level fromLevel,
boolean passThrough,
Collector<TestLogRecord,?,T> collector)
Collect a bunch of logs.
|
<T> LogCollection<T> |
TestLoggers.collect(String category,
Level fromLevel,
boolean passThrough,
org.hamcrest.Matcher<TestLogRecord> matcher,
Collector<TestLogRecord,?,T> collector)
Collect matching logs.
|
LogCollection<ArrayDeque<TestLogRecord>> |
TestLoggers.collect(String category,
Level minimumLogLevel,
boolean collectPrinted,
Predicate<TestLogRecord> collectorFilter,
Collector<TestLogRecord,?,ArrayDeque<TestLogRecord>> pcollector) |
LogCollection<ArrayDeque<TestLogRecord>> |
TestLoggers.collect(String category,
Level minimumLogLevel,
int maxNrLogs,
boolean collectPrinted,
Predicate<TestLogRecord> collectorFilter) |
<R> LogCollection<R> |
TestLoggers.collect(String category,
Level fromLevel,
Level toLevel,
boolean passThrough,
Collector<TestLogRecord,?,R> collector,
ToIntFunction<List<LogHandler>> whereTo) |
<T> LogCollection<T> |
TestLoggers.collect(String category,
Level fromLevel,
Level toLevel,
boolean passThrough,
Collector<TestLogRecord,?,T> collector)
Collect a bunch of logs.
|
LogAssert |
TestLoggers.dontExpect(String category,
Level minimumLogLevel,
org.hamcrest.Matcher<TestLogRecord>... matchers)
the opposite of expect.
|
LogAssert |
TestLoggers.expect(String category,
Level fromLevel,
boolean passThrough,
org.hamcrest.Matcher<TestLogRecord> matcher,
org.hamcrest.Matcher<Iterable<TestLogRecord>> matchedMatcher)
expect a stream of logs filtered by a matcher, this strem will be matched against the matchedMatcher.
|
LogAssert |
TestLoggers.expect(String category,
Level minimumLogLevel,
int nrTimes,
long timeout,
TimeUnit unit,
org.hamcrest.Matcher<TestLogRecord>... matchers) |
LogAssert |
TestLoggers.expect(String category,
Level minimumLogLevel,
int nrTimes,
org.hamcrest.Matcher<TestLogRecord>... matchers)
Ability to assert is you expect a sequence of logs to be repeated.
|
LogAssert |
TestLoggers.expect(String category,
Level minimumLogLevel,
long timeout,
TimeUnit unit,
org.hamcrest.Matcher<TestLogRecord>... matchers) |
LogAssert |
TestLoggers.expect(String category,
Level minimumLogLevel,
org.hamcrest.Matcher<TestLogRecord>... matchers)
Create an log expectation that can be asserted like:
LogAssert expect = TestLoggers.expect("org.spf4j.test", Level.ERROR, Matchers.hasProperty("format",
Matchers.equalTo("Booo")));
LOG.error("Booo", new RuntimeException());
expect.assertObservation();
|
LogConsumer |
LogConfig.getLogConsumer(String category,
Level level) |
LogHandler.Handling |
GreedyLogPrinter.handles(Level level) |
LogHandler.Handling |
LogPrinter.handles(Level level)
find out if this handler should be used for the given log level.
|
default LogHandler.Handling |
AllLevelsLogHandler.handles(Level level) |
LogHandler.Handling |
LogHandler.handles(Level level)
find out if this handler should be used for the given log level.
|
HandlerRegistration |
TestLoggers.ignore(String category,
Level from,
Level to)
all logs from category and specified levels will be ignored...
|
void |
TestLogger.log(Level level,
org.slf4j.Marker marker,
String msg,
Object... args) |
void |
TestLoggers.print(String category,
Level level)
Print logs above a category and log level.
|
void |
TestLoggers.print(String category,
Level level,
boolean greedy) |
| Constructor and Description |
|---|
PrintConfig(String category,
Level minLevel,
boolean greedy) |
TestLogRecordImpl(String loggerName,
Level level,
org.slf4j.Marker marker,
String format,
Object... arguments) |
TestLogRecordImpl(String loggerName,
Level level,
String format,
Object... arguments) |
| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.Matcher<TestLogRecord> |
LogMatchers.hasLevel(Level level) |
Copyright © 2019 SPF4J. All rights reserved.