From bf636519197916cb7d83a2fda64f6c4537b28815 Mon Sep 17 00:00:00 2001 From: Matus Valo Date: Sun, 15 May 2022 21:04:44 +0200 Subject: [PATCH] Added logging-too-many-args message example --- doc/data/messages/l/logging-too-many-args/bad.py | 7 +++++++ doc/data/messages/l/logging-too-many-args/good.py | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 doc/data/messages/l/logging-too-many-args/bad.py create mode 100644 doc/data/messages/l/logging-too-many-args/good.py diff --git a/doc/data/messages/l/logging-too-many-args/bad.py b/doc/data/messages/l/logging-too-many-args/bad.py new file mode 100644 index 0000000000..f94222aa4f --- /dev/null +++ b/doc/data/messages/l/logging-too-many-args/bad.py @@ -0,0 +1,7 @@ +import logging + +try: + function() +except Exception as e: + logging.error('Error occured: %s', type(e), e) # [logging-too-many-args] + raise diff --git a/doc/data/messages/l/logging-too-many-args/good.py b/doc/data/messages/l/logging-too-many-args/good.py new file mode 100644 index 0000000000..3772c59b20 --- /dev/null +++ b/doc/data/messages/l/logging-too-many-args/good.py @@ -0,0 +1,7 @@ +import logging + +try: + function() +except Exception as e: + logging.error('%s error occured: %s', type(e), e) + raise