FakeLog Class

Summary

Implementation of a ICakeLog that saves all messages written to it.
Namespace
Cake.Testing
Interfaces
Base Types
  • object
graph BT Type-->Base0["object"] Type-.->Interface0["ICakeLog"] click Interface0 "/api/Cake.Core.Diagnostics/ICakeLog" Type["FakeLog"] class Type type-node

Syntax

public sealed class FakeLog : ICakeLog

Constructors

Name Summary
FakeLog() Initializes a new instance of the FakeLog class.

Properties

Name Value Summary
Entries IReadOnlyList<FakeLogMessage>
Gets the messages.
Verbosity Verbosity
Gets or sets the verbosity.

Methods

Name Value Summary
Write(Verbosity, LogLevel, string, object[]) void
Writes the text representation of the specified array of objects to the log using the specified verbosity, log level and format information.

Extension Methods

Name Value Summary
AggregateLogMessages() string
Aggregates all current log entries message.
Debug(LogAction) void
Writes a debug message to the log using the specified log message action. Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
Debug(object) void
Writes a debug message to the log using the specified value.
Debug(string, object[]) void
Writes a debug message to the log using the specified format information.
Debug(string) void
Writes a debug message to the log using the specified string value.
Debug(Verbosity, LogAction) void
Writes a debug message to the log using the specified verbosity and log message action. Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
Debug(Verbosity, string, object[]) void
Writes a debug message to the log using the specified verbosity and format information.
DiagnosticVerbosity() IDisposable
Sets the log verbosity to diagnostic and returns a disposable that restores the log verbosity on dispose.
Dump<FakeLog>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
Error(LogAction) void
Writes an error message to the log using the specified log message action. Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
Error(object) void
Writes an error message to the log using the specified value.
Error(string, object[]) void
Writes an error message to the log using the specified format information.
Error(string) void
Writes an error message to the log using the specified string value.
Error(Verbosity, LogAction) void
Writes an error message to the log using the specified verbosity and log message action. Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
Error(Verbosity, string, object[]) void
Writes an error message to the log using the specified verbosity and format information.
Information(LogAction) void
Writes an informational message to the log using the specified log message action. Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
Information(object) void
Writes an informational message to the log using the specified value.
Information(string, object[]) void
Writes an informational message to the log using the specified format information.
Information(string) void
Writes an informational message to the log using the specified string value.
Information(Verbosity, LogAction) void
Writes an informational message to the log using the specified verbosity and log message action. Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
Information(Verbosity, string, object[]) void
Writes an informational message to the log using the specified verbosity and format information.
IsIn<FakeLog>(FakeLog[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
LogException<T>(T) int
Logs exception and returns exit code if available in exception.
MinimalVerbosity() IDisposable
Sets the log verbosity to minimal and returns a disposable that restores the log verbosity on dispose.
NormalVerbosity() IDisposable
Sets the log verbosity to normal and returns a disposable that restores the log verbosity on dispose.
NotNull<FakeLog>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
NotNull<FakeLog>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
QuietVerbosity() IDisposable
Sets the log verbosity to quiet and returns a disposable that restores the log verbosity on dispose.
ThrowIfNull<FakeLog>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<FakeLog>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin
ToStringWithNullMarkup() string
Returns the string value or a Not set> markup suitable for Spectre.Console.
Requires the Cake.Issues addin
Verbose(LogAction) void
Writes a verbose message to the log using the specified log message action. Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
Verbose(object) void
Writes a verbose message to the log using the specified value.
Verbose(string, object[]) void
Writes a verbose message to the log using the specified format information.
Verbose(string) void
Writes a verbose message to the log using the specified string value.
Verbose(Verbosity, LogAction) void
Writes a verbose message to the log using the specified verbosity and log message action. Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
Verbose(Verbosity, string, object[]) void
Writes a verbose message to the log using the specified verbosity and format information.
VerboseVerbosity() IDisposable
Sets the log verbosity to verbose and returns a disposable that restores the log verbosity on dispose.
Warning(LogAction) void
Writes a warning message to the log using the specified log message action. Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
Warning(object) void
Writes an warning message to the log using the specified value.
Warning(string, object[]) void
Writes a warning message to the log using the specified format information.
Warning(string) void
Writes an warning message to the log using the specified string value.
Warning(Verbosity, LogAction) void
Writes a warning message to the log using the specified verbosity and log message action. Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.
Warning(Verbosity, string, object[]) void
Writes a warning message to the log using the specified verbosity and format information.
WithVerbosity(Verbosity) IDisposable
Sets the log verbosity as specified and returns a disposable that restores the log verbosity on dispose.
Write(Verbosity, LogLevel, LogAction) void
Writes a message to the log using the specified verbosity, log level and log action delegate. Evaluates log message only if the verbosity is equal to or more verbose than the log's verbosity.