Logger.WriteIf

WriteIf(bool, string)

Writes the specified message to appenders if condition is true.

public void WriteIf(bool condition, string message)
ParameterTypeDescription
conditionBooleanThe condition to test.
messageStringThe message to write.

See Also


WriteIf(bool, object)

Writes the specified message to appenders if condition is true.

public void WriteIf(bool condition, object message)
ParameterTypeDescription
conditionBooleanThe condition to test.
messageObjectThe message to write.

See Also


WriteIf(bool, object, Exception)

Writes the specified message and exception to appenders if condition is true.

public void WriteIf(bool condition, object message, Exception exception)
ParameterTypeDescription
conditionBooleanThe condition to test.
messageObjectThe message to write.
exceptionExceptionThe exception to write.

See Also


WriteIf(LogLevel, string)

Writes the specified message if the log level is enabled.

public void WriteIf(LogLevel condition, string message)
ParameterTypeDescription
conditionLogLevelThe log level.
messageStringThe message to log.

See Also


WriteIf(LogLevel, string, Exception)

Writes the specified message and exception if the log level is enabled.

public void WriteIf(LogLevel condition, string message, Exception exception)
ParameterTypeDescription
conditionLogLevelThe log level.
messageStringThe message to log.
exceptionExceptionThe exception to log.

See Also