Class FakeLogService
Lightweight spy implementation of Serenity.Logging.Application.Interfaces.ILogService for infrastructure tests.
Records the messages passed to each Write* method so tests can assert on logging behavior
without producing real Unity console output (which would trip the test runner's log assertions).
Inheritance
FakeLogService
Implements
ILogService
IService
IFoundationSettings
Assembly: Tests.dll
public sealed class FakeLogService : ILogService, IService, IFoundationSettings
Constructors
Declaration
Fields
Declaration
public readonly List<string> ErrorMessages
Field Value
Declaration
public readonly List<Exception> Exceptions
Field Value
Declaration
public readonly List<string> InformationMessages
Field Value
Declaration
public readonly List<string> VerboseMessages
Field Value
Declaration
public readonly List<string> WarningMessages
Field Value
Properties
Declaration
public string Guid { get; set; }
Property Value
Declaration
public string Id { get; set; }
Property Value
Declaration
public ILogService LogService { get; set; }
Property Value
| Type |
Description |
| ILogService |
|
Declaration
public LogVerbosity Verbosity { get; set; }
Property Value
| Type |
Description |
| LogVerbosity |
|
Methods
Declaration
public void ClearCategoryVerbosity(string category)
Parameters
| Type |
Name |
Description |
| string |
category |
|
Declaration
public ILoggerComponent For(string category)
Parameters
| Type |
Name |
Description |
| string |
category |
|
Returns
| Type |
Description |
| ILoggerComponent |
|
Declaration
public LogVerbosity GetEffectiveVerbosity(string category)
Parameters
| Type |
Name |
Description |
| string |
category |
|
Returns
| Type |
Description |
| LogVerbosity |
|
IsEnabledFor(string, LogSeverity)
Declaration
public bool IsEnabledFor(string category, LogSeverity severity)
Parameters
| Type |
Name |
Description |
| string |
category |
|
| LogSeverity |
severity |
|
Returns
SetCategoryVerbosity(string, LogVerbosity?)
Declaration
public void SetCategoryVerbosity(string category, LogVerbosity? verbosity)
Parameters
| Type |
Name |
Description |
| string |
category |
|
| LogVerbosity? |
verbosity |
|
Declaration
public void WriteErrorLog(string message, string category = null, params string[] tags)
Parameters
Declaration
public void WriteExceptionLog(Exception exception, string message = null, string category = null, params string[] tags)
Parameters
Declaration
public void WriteInformationLog(string message, string category = null, params string[] tags)
Parameters
WriteLog(LogEntry)
Declaration
public void WriteLog(LogEntry entry)
Parameters
| Type |
Name |
Description |
| LogEntry |
entry |
|
Declaration
public void WriteVerboseLog(string message, string category = null, params string[] tags)
Parameters
Declaration
public void WriteWarningLog(string message, string category = null, params string[] tags)
Parameters
Implements
Serenity.Logging.Application.Interfaces.ILogService
Serenity.Global.Application.Interfaces.IService
Serenity.Global.Domain.Interfaces.IFoundationSettings