---
source: crates/ruff_linter/src/rules/flake8_logging/mod.rs
---
LOG002.py:11:11: LOG002 [*] Use `__name__` with `logging.getLogger()`
   |
10 | # LOG002
11 | getLogger(__file__)
   |           ^^^^^^^^ LOG002
12 | logging.getLogger(name=__file__)
   |
   = help: Replace with `__name__`

ℹ Unsafe fix
8  8  | logging.getLogger(name="custom")
9  9  | 
10 10 | # LOG002
11    |-getLogger(__file__)
   11 |+getLogger(__name__)
12 12 | logging.getLogger(name=__file__)
13 13 | 
14 14 | logging.getLogger(__cached__)

LOG002.py:12:24: LOG002 [*] Use `__name__` with `logging.getLogger()`
   |
10 | # LOG002
11 | getLogger(__file__)
12 | logging.getLogger(name=__file__)
   |                        ^^^^^^^^ LOG002
13 |
14 | logging.getLogger(__cached__)
   |
   = help: Replace with `__name__`

ℹ Unsafe fix
9  9  | 
10 10 | # LOG002
11 11 | getLogger(__file__)
12    |-logging.getLogger(name=__file__)
   12 |+logging.getLogger(name=__name__)
13 13 | 
14 14 | logging.getLogger(__cached__)
15 15 | getLogger(name=__cached__)

LOG002.py:14:19: LOG002 [*] Use `__name__` with `logging.getLogger()`
   |
12 | logging.getLogger(name=__file__)
13 |
14 | logging.getLogger(__cached__)
   |                   ^^^^^^^^^^ LOG002
15 | getLogger(name=__cached__)
   |
   = help: Replace with `__name__`

ℹ Unsafe fix
11 11 | getLogger(__file__)
12 12 | logging.getLogger(name=__file__)
13 13 | 
14    |-logging.getLogger(__cached__)
   14 |+logging.getLogger(__name__)
15 15 | getLogger(name=__cached__)
16 16 | 
17 17 | 

LOG002.py:15:16: LOG002 [*] Use `__name__` with `logging.getLogger()`
   |
14 | logging.getLogger(__cached__)
15 | getLogger(name=__cached__)
   |                ^^^^^^^^^^ LOG002
   |
   = help: Replace with `__name__`

ℹ Unsafe fix
12 12 | logging.getLogger(name=__file__)
13 13 | 
14 14 | logging.getLogger(__cached__)
15    |-getLogger(name=__cached__)
   15 |+getLogger(name=__name__)
16 16 | 
17 17 | 
18 18 | # Override `logging.getLogger`
