Table of Contents

Class ILogExtensions

Namespace
ToSic.Lib.Logging
Assembly
ToSic.Lib.Core.dll

Various extensions for ILog objects to add logs. They are all implemented as extension methods, so that they will not fail even if the log object is null.

[PublicApi]
public static class ILogExtensions
Inheritance
ILogExtensions

Methods

Try(ILog, Func<string>, string)

Special helper to use a function to create a message, but ignore any errors to avoid problems when only logging.

[InternalApi_DoNotUse_MayChangeWithoutNotice("will probably be moved elsewhere some day")]
public static string Try(this ILog log, Func<string> messageMaker, string errorMessage = null)

Parameters

log ILog

The log object - not used, just for syntax

messageMaker Func<string>

Function to generate the message.

errorMessage string

Message to show if it fails

Returns

string