LoggingAliases.

WithVerbosity(ICakeContext, Verbosity) Method

Summary

Sets the log verbosity as specified and returns a disposable that restores the log verbosity on dispose.
Namespace
Cake.Common.Diagnostics
Containing Type
LoggingAliases

Syntax

[CakeMethodAlias]
[CakeAliasCategory("Verbosity")]
public static IDisposable WithVerbosity(this ICakeContext context, Verbosity verbosity)

Examples

using (DiagnosticVerbosity())
{
    Error("Show me.");
    Warning("Show me.");
    Information("Show me.");
    Verbose("Show me.");
    Debug("Show me.");
}

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.
CakeAliasCategoryAttribute An attribute used for documentation of alias methods/properties.

Parameters

Name Type Description
context ICakeContext The context.
verbosity Verbosity The verbosity.

Return Value

Type Description
IDisposable A disposable that restores the log verbosity.