WriteIf

Logger.WriteIf method (1 of 5)

Writes the specified message to appenders if condition is true.

public void WriteIf(bool condition, string message)
Parameter Type Description
condition Boolean The condition to test.
message String The message to write.

See Also


Logger.WriteIf method (2 of 5)

Writes the specified message to appenders if condition is true.

public void WriteIf(bool condition, object message)
Parameter Type Description
condition Boolean The condition to test.
message Object The message to write.

See Also


Logger.WriteIf method (3 of 5)

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

public void WriteIf(bool condition, object message, Exception exception)
Parameter Type Description
condition Boolean The condition to test.
message Object The message to write.
exception Exception The exception to write.

See Also


Logger.WriteIf method (4 of 5)

Writes the specified message if the log level is enabled.

public void WriteIf(LogLevel condition, string message)
Parameter Type Description
condition LogLevel The log level.
message String The message to log.

See Also


Logger.WriteIf method (5 of 5)

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

public void WriteIf(LogLevel condition, string message, Exception exception)
Parameter Type Description
condition LogLevel The log level.
message String The message to log.
exception Exception The exception to log.

See Also