### Summary

If you run `ANSIBLE_LOG_PATH=test ansible localhost -m setup`, `test` is now an empty file. Before #81692 got merged, it contained log output like
```
023-11-16 08:01:52,262 p=313108 u=felix n=ansible | [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development.
This is a rapidly changing source of code and can become unstable at any point.

2023-11-16 08:01:52,383 p=313108 u=felix n=ansible | [WARNING]: No inventory was parsed, only implicit localhost is available

2023-11-16 08:01:53,511 p=313108 u=felix n=ansible | localhost | SUCCESS => {
    "ansible_facts": {
...
```

### Issue Type

Bug Report

### Component Name

logging

### Ansible Version

```console
latest devel branch
```


### Configuration

```console
-
```


### OS / Environment

-

### Steps to Reproduce

Run `ANSIBLE_LOG_PATH=test ansible localhost -m setup`

### Expected Results

File `test` contains log output.

### Actual Results

```console
File `test` is empty.
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
if C.SYSTEM_WARNINGS:
            self.warning(msg)
    def banner(self, msg: str, color: str | None = None, cows: bool = True) -> None:
        '''
        Prints a header-looking line with cowsay or stars with length depending on terminal width (3 minimum)
        '''
        msg = to_text(msg)
        if self.b_cowsay and cows:
            try:
                self.banner_cowsay(msg)
                return
            except OSError:
                self.warning("somebody cleverly deleted cowsay or something during the PB run.  heh.")
        msg = msg.strip()
        try:
            star_len = self.columns - get_text_width(msg)
        except EnvironmentError:
            star_len = self.columns - len(msg)
        if star_len <= 3:
            star_len = 3
        stars = u"*" * star_len
        self.display(u"\n%s %s" % (msg, stars), color=color)
    def banner_cowsay(self, msg: str, color: str | None = None) -> None: