Class MockLogger
Example:
   
See Also:
- 
Field SummaryFields inherited from class java.util.logging.Loggerglobal, GLOBAL_LOGGER_NAME
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAllows you to perform fluent-style assertions on the contents of the log file.assertLastLevel(Level level) Asserts that the last message was logged at the specified level.Asserts that the last message matched the specified message.Asserts that this logger was called.Asserts that the specified number of messages have been logged.static MockLoggercreate()Creator.Specifies the format for messages sent to the log file.Overrides the formatter to use for formatting messages.Sets the level for this logger.voidreset()Resets this logger.toString()Returns the contents of this log file as a string.Methods inherited from class java.util.logging.LoggeraddHandler, config, config, entering, entering, entering, exiting, exiting, fine, fine, finer, finer, finest, finest, getAnonymousLogger, getAnonymousLogger, getFilter, getGlobal, getHandlers, getLevel, getLogger, getLogger, getName, getParent, getResourceBundle, getResourceBundleName, getUseParentHandlers, info, info, isLoggable, log, log, log, log, log, log, logp, logp, logp, logp, logp, logp, logrb, logrb, logrb, logrb, logrb, logrb, logrb, logrb, removeHandler, setFilter, setLevel, setParent, setResourceBundle, setUseParentHandlers, severe, severe, throwing, warning, warning
- 
Constructor Details- 
MockLoggerpublic MockLogger()Constructor.
 
- 
- 
Method Details- 
createCreator.- Returns:
- A new MockLoggerobject.
 
- 
log
- 
levelSets the level for this logger.- Parameters:
- level- The new level for this logger.
- Returns:
- This object.
 
- 
formatSpecifies the format for messages sent to the log file.See SimpleFormatter.format(LogRecord)for the syntax of this string.- Parameters:
- format- The format string.
- Returns:
- This object.
 
- 
formatterOverrides the formatter to use for formatting messages.The default uses SimpleFormatter.- Parameters:
- formatter- The log record formatter.
- Returns:
- This object.
 
- 
resetResets this logger.- Returns:
- This object.
 
- 
assertLoggedAsserts that this logger was called.- Returns:
- This object.
 
- 
assertLastLevelAsserts that the last message was logged at the specified level.- Parameters:
- level- The level to match against.
- Returns:
- This object.
 
- 
assertLastMessageAsserts that the last message matched the specified message.- Returns:
- This object.
 
- 
assertRecordCountAsserts that the specified number of messages have been logged.- Returns:
- This object.
 
- 
assertContentsAllows you to perform fluent-style assertions on the contents of the log file.- Returns:
- A new fluent-style assertion object.
 
- 
toStringReturns the contents of this log file as a string.
 
-