From c0681969693dfea3dbd5e91784a46704abfd1e78 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Thu, 21 Apr 2022 15:33:48 -0700 Subject: [PATCH 1/2] Fix wrong `log_file` docs --- doc/en/how-to/logging.rst | 3 +++ doc/en/reference/reference.rst | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/en/how-to/logging.rst b/doc/en/how-to/logging.rst index 2e8734fa6a3..b724873a44a 100644 --- a/doc/en/how-to/logging.rst +++ b/doc/en/how-to/logging.rst @@ -198,6 +198,9 @@ option names are: If you need to record the whole test suite logging calls to a file, you can pass ``--log-file=/path/to/log/file``. This log file is opened in write mode which means that it will be overwritten at each run tests session. +Note that relative paths for the log-file location are always resolved relative +to the current working directory, whether passed on the CLI or declared in a +config file. You can also specify the logging level for the log file by passing ``--log-file-level``. This setting accepts the logging level names as seen in diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index aec384d6d33..167c8fed9a3 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1514,7 +1514,7 @@ passed multiple times. The expected format is ``name=value``. For example:: - Sets a file name relative to the ``pytest.ini`` file where log messages should be written to, in addition + Sets a file name relative to the current working directory where log messages should be written to, in addition to the other logging facilities that are active. .. code-block:: ini From 0e56ebaa68b36ce5b57095a64d8913b1c4658a1a Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Fri, 22 Apr 2022 09:14:46 -0700 Subject: [PATCH 2/2] Update doc/en/how-to/logging.rst Co-authored-by: Bruno Oliveira --- doc/en/how-to/logging.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/en/how-to/logging.rst b/doc/en/how-to/logging.rst index b724873a44a..5a089c2fba0 100644 --- a/doc/en/how-to/logging.rst +++ b/doc/en/how-to/logging.rst @@ -198,9 +198,8 @@ option names are: If you need to record the whole test suite logging calls to a file, you can pass ``--log-file=/path/to/log/file``. This log file is opened in write mode which means that it will be overwritten at each run tests session. -Note that relative paths for the log-file location are always resolved relative -to the current working directory, whether passed on the CLI or declared in a -config file. +Note that relative paths for the log-file location, whether passed on the CLI or declared in a +config file, are always resolved relative to the current working directory. You can also specify the logging level for the log file by passing ``--log-file-level``. This setting accepts the logging level names as seen in