Main Content

matlab.unittest.plugins.LoggingPlugin class

Package: matlab.unittest.plugins

Plugin to report diagnostic messages

Description

The LoggingPlugin creates a plugin to report diagnostic messages that are created by the log method of a TestCase or Fixture.

Construction

Instantiate a LoggingPlugin using one of its static methods.

Use the withVerbosity static method to configure a plugin to respond to messages of a particular verbosity. Also, the withVerbosity method accepts a number of name/value pairs to configure the format for reporting logged messages.

Properties

expand all

Logged diagnostic message description, specified as a character vector or string scalar. The value of this property is printed alongside each logged diagnostic message. Description is read only, and its value is set during construction.

Indicator to display the verbosity level alongside each logged diagnostic, specified as false (logical(0)) or true (logical(1)). By default, this property is false and the test framework displays the verbosity level. HideLevel is read only, and its value is set during construction.

Indicator to display the timestamp from when the test framework generates the logged message alongside each logged diagnostic, specified as false (logical(0)) or true (logical(1)). By default, this property is false and the test framework displays the timestamp. HideTimestamp is read only, and its value is set during construction.

Number of stack frames to display after each logged diagnostic message, specified as an integer value. By default, this property is 0, and the test framework does not display stack information. If NumStackFrames is Inf, the test framework displays all available stack frames. NumStackFrames is read only, and its value is set during construction.

Verbosity levels supported by plugin instance, specified as an array of matlab.unittest.Verbosity instances. The plugin reacts to diagnostics that are logged at a verbosity level listed in this array. Verbosity is read only, and its value is set during construction.

Methods

withVerbosityConstruct LoggingPlugin for messages of specified verbosity

Copy Semantics

Handle. To learn how handle classes affect copy operations, see Copying Objects.

Introduced in R2014b