---
source: crates/ruff_linter/src/rules/flake8_logging/mod.rs
---
LOG007 Use of `logging.exception` with falsy `exc_info`
 --> LOG007.py:6:1
  |
5 | logging.exception("foo")  # OK
6 | logging.exception("foo", exc_info=False)  # LOG007
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 | logging.exception("foo", exc_info=[])  # LOG007
8 | logger.exception("foo")  # OK
  |

LOG007 Use of `logging.exception` with falsy `exc_info`
 --> LOG007.py:7:1
  |
5 | logging.exception("foo")  # OK
6 | logging.exception("foo", exc_info=False)  # LOG007
7 | logging.exception("foo", exc_info=[])  # LOG007
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 | logger.exception("foo")  # OK
9 | logger.exception("foo", exc_info=False)  # LOG007
  |

LOG007 Use of `logging.exception` with falsy `exc_info`
  --> LOG007.py:9:1
   |
 7 | logging.exception("foo", exc_info=[])  # LOG007
 8 | logger.exception("foo")  # OK
 9 | logger.exception("foo", exc_info=False)  # LOG007
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 | logger.exception("foo", exc_info=[])  # LOG007
11 | logger.error("foo", exc_info=False)  # OK
   |

LOG007 Use of `logging.exception` with falsy `exc_info`
  --> LOG007.py:10:1
   |
 8 | logger.exception("foo")  # OK
 9 | logger.exception("foo", exc_info=False)  # LOG007
10 | logger.exception("foo", exc_info=[])  # LOG007
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 | logger.error("foo", exc_info=False)  # OK
12 | logger.info("foo", exc_info=False)  # OK
   |

LOG007 Use of `logging.exception` with falsy `exc_info`
  --> LOG007.py:17:1
   |
15 | from logging import exception
16 |
17 | exception("foo", exc_info=False)  # LOG007
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18 | exception("foo", exc_info=True)  # OK
   |
