
## WriteIf (1 of 5) {#writeif_1}

Writes the specified message to appenders if condition is true.

**Returns:** void Aspose::Email::Tools::Logging::

```cpp
WriteIf(bool condition, System::SharedPtr < System::Object > message)
```

| Parameter | Description |
| --- | --- |
| condition | The condition to test. |
| message | The message to write. |

---

## WriteIf (2 of 5) {#writeif_2}

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

**Returns:** void Aspose::Email::Tools::Logging::

```cpp
WriteIf(bool condition, System::SharedPtr < System::Object > message, System::Exception exception)
```

| Parameter | Description |
| --- | --- |
| condition | The condition to test. |
| message | The message to write. |
| exception | The exception to write. |

---

## WriteIf (3 of 5) {#writeif_3}

Writes the specified message to appenders if condition is true.

**Returns:** void Aspose::Email::Tools::Logging::

```cpp
WriteIf(bool condition, System::String message)
```

| Parameter | Description |
| --- | --- |
| condition | The condition to test. |
| message | The message to write. |

---

## WriteIf (4 of 5) {#writeif_4}

Writes the specified message if the log level is enabled.

**Returns:** void Aspose::Email::Tools::Logging::

```cpp
WriteIf(System::SharedPtr < LogLevel > condition, System::String message)
```

| Parameter | Description |
| --- | --- |
| condition | The log level. |
| message | The message to log. |

---

## WriteIf (5 of 5) {#writeif_5}

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

**Returns:** void Aspose::Email::Tools::Logging::

```cpp
WriteIf(System::SharedPtr < LogLevel > condition, System::String message, System::Exception exception)
```

| Parameter | Description |
| --- | --- |
| condition | The log level. |
| message | The message to log. |
| exception | The exception to log. |

