---
source: crates/ruff_linter/src/rules/flake8_logging_format/mod.rs
---
G001.py:4:14: G001 Logging statement uses `str.format`
  |
2 | import logging as foo
3 | 
4 | logging.info("Hello {}".format("World!"))
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
5 | logging.log(logging.INFO, "Hello {}".format("World!"))
6 | foo.info("Hello {}".format("World!"))
  |

G001.py:5:27: G001 Logging statement uses `str.format`
  |
4 | logging.info("Hello {}".format("World!"))
5 | logging.log(logging.INFO, "Hello {}".format("World!"))
  |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
6 | foo.info("Hello {}".format("World!"))
7 | logging.log(logging.INFO, msg="Hello {}".format("World!"))
  |

G001.py:6:10: G001 Logging statement uses `str.format`
  |
4 | logging.info("Hello {}".format("World!"))
5 | logging.log(logging.INFO, "Hello {}".format("World!"))
6 | foo.info("Hello {}".format("World!"))
  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
7 | logging.log(logging.INFO, msg="Hello {}".format("World!"))
8 | logging.log(level=logging.INFO, msg="Hello {}".format("World!"))
  |

G001.py:7:31: G001 Logging statement uses `str.format`
  |
5 | logging.log(logging.INFO, "Hello {}".format("World!"))
6 | foo.info("Hello {}".format("World!"))
7 | logging.log(logging.INFO, msg="Hello {}".format("World!"))
  |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
8 | logging.log(level=logging.INFO, msg="Hello {}".format("World!"))
9 | logging.log(msg="Hello {}".format("World!"), level=logging.INFO)
  |

G001.py:8:37: G001 Logging statement uses `str.format`
  |
6 | foo.info("Hello {}".format("World!"))
7 | logging.log(logging.INFO, msg="Hello {}".format("World!"))
8 | logging.log(level=logging.INFO, msg="Hello {}".format("World!"))
  |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
9 | logging.log(msg="Hello {}".format("World!"), level=logging.INFO)
  |

G001.py:9:17: G001 Logging statement uses `str.format`
   |
 7 | logging.log(logging.INFO, msg="Hello {}".format("World!"))
 8 | logging.log(level=logging.INFO, msg="Hello {}".format("World!"))
 9 | logging.log(msg="Hello {}".format("World!"), level=logging.INFO)
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
10 | 
11 | # Flask support
   |

G001.py:16:31: G001 Logging statement uses `str.format`
   |
14 | from flask import current_app as app
15 | 
16 | flask.current_app.logger.info("Hello {}".format("World!"))
   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
17 | current_app.logger.info("Hello {}".format("World!"))
18 | app.logger.log(logging.INFO, "Hello {}".format("World!"))
   |

G001.py:17:25: G001 Logging statement uses `str.format`
   |
16 | flask.current_app.logger.info("Hello {}".format("World!"))
17 | current_app.logger.info("Hello {}".format("World!"))
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
18 | app.logger.log(logging.INFO, "Hello {}".format("World!"))
   |

G001.py:18:30: G001 Logging statement uses `str.format`
   |
16 | flask.current_app.logger.info("Hello {}".format("World!"))
17 | current_app.logger.info("Hello {}".format("World!"))
18 | app.logger.log(logging.INFO, "Hello {}".format("World!"))
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
19 | 
20 | from logging import info, log
   |

G001.py:22:6: G001 Logging statement uses `str.format`
   |
20 | from logging import info, log
21 | 
22 | info("Hello {}".format("World!"))
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
23 | log(logging.INFO, "Hello {}".format("World!"))
24 | info("Hello {}".format("World!"))
   |

G001.py:23:19: G001 Logging statement uses `str.format`
   |
22 | info("Hello {}".format("World!"))
23 | log(logging.INFO, "Hello {}".format("World!"))
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
24 | info("Hello {}".format("World!"))
25 | log(logging.INFO, msg="Hello {}".format("World!"))
   |

G001.py:24:6: G001 Logging statement uses `str.format`
   |
22 | info("Hello {}".format("World!"))
23 | log(logging.INFO, "Hello {}".format("World!"))
24 | info("Hello {}".format("World!"))
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
25 | log(logging.INFO, msg="Hello {}".format("World!"))
26 | log(level=logging.INFO, msg="Hello {}".format("World!"))
   |

G001.py:25:23: G001 Logging statement uses `str.format`
   |
23 | log(logging.INFO, "Hello {}".format("World!"))
24 | info("Hello {}".format("World!"))
25 | log(logging.INFO, msg="Hello {}".format("World!"))
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
26 | log(level=logging.INFO, msg="Hello {}".format("World!"))
27 | log(msg="Hello {}".format("World!"), level=logging.INFO)
   |

G001.py:26:29: G001 Logging statement uses `str.format`
   |
24 | info("Hello {}".format("World!"))
25 | log(logging.INFO, msg="Hello {}".format("World!"))
26 | log(level=logging.INFO, msg="Hello {}".format("World!"))
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
27 | log(msg="Hello {}".format("World!"), level=logging.INFO)
   |

G001.py:27:9: G001 Logging statement uses `str.format`
   |
25 | log(logging.INFO, msg="Hello {}".format("World!"))
26 | log(level=logging.INFO, msg="Hello {}".format("World!"))
27 | log(msg="Hello {}".format("World!"), level=logging.INFO)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ G001
   |


