From 82cc095b74acb018b99304cdbb7c9abda52fec75 Mon Sep 17 00:00:00 2001 From: Daniel Biehl Date: Tue, 15 Nov 2022 13:43:09 +0100 Subject: [PATCH] remove unused coloredlogs code --- .vscode/launch.json | 1 - log.ini | 53 +++++++-------------- poetry.lock | 63 +++++++------------------ pyproject.toml | 2 - robotcode/debugger/__main__.py | 14 +----- robotcode/debugger/launcher/__main__.py | 14 +----- robotcode/language_server/__main__.py | 21 +-------- robotcode/utils/async_tools.py | 2 +- robotcode/utils/logging.py | 18 +++---- 9 files changed, 48 insertions(+), 140 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 346719277..50a06617c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -168,7 +168,6 @@ "--mode", "tcp", "--log", - "--log-colored", "--log-level", "TRACE", //"--log-json-rpc-data", diff --git a/log.ini b/log.ini index 4f112c700..f46d9688a 100644 --- a/log.ini +++ b/log.ini @@ -10,124 +10,105 @@ keys: root [formatters] -#keys: detailed,simple,colored_simple -keys: detailed,simple,colored_detailed +keys: detailed,simple [handlers] -keys: console, colored_console -#keys: console +keys: console [formatter_simple] -#format=%(asctime)s - %(name)s - %(levelname)s - %(message)s -format: %(name)s:%(levelname)s: %(message)s - -[formatter_colored_simple] -class: coloredlogs.ColoredFormatter -#format=%(asctime)s - %(name)s - %(levelname)s - %(message)s format: %(name)s:%(levelname)s: %(message)s [formatter_detailed] format: %(name)s:%(levelname)s %(threadName)s(%(thread)d) %(module)s:%(funcName)s: %(message)s (%(pathname)s:%(lineno)d) -[formatter_colored_detailed] -class: coloredlogs.ColoredFormatter -format: %(name)s:%(levelname)s %(threadName)s(%(thread)d) %(module)s:%(funcName)s: %(message)s (%(pathname)s:%(lineno)d) - [handler_console] class: StreamHandler args: [] formatter: detailed -[handler_colored_console] -class: StreamHandler -args: [] -formatter: colored_detailed - [logger_root] level: INFO -#handlers: colored_console handlers: console propagate: 1 [logger_server] level: TRACE -handlers: +handlers: qualname: robotcode.language_server #propagate: 0 [logger_language_server] level: TRACE -handlers: +handlers: qualname: robotcode.language_server.common [logger_language_server_parts] level: TRACE -handlers: +handlers: qualname: robotcode.language_server.common.parts #propagate: 0 [logger_robotframework] level: TRACE -handlers: +handlers: qualname: robotcode.language_server.robotframework #propagate: 0 [logger_jsonrpc2] level: TRACE -handlers: +handlers: qualname: robotcode.jsonrpc2 #propagate: 0 [logger_jsonrpc2_message] level: INFO -handlers: +handlers: qualname: robotcode.jsonrpc2.protocol.JsonRPCProtocol.message propagate: 0 [logger_debugger] level: TRACE -handlers: +handlers: qualname: robotcode.debugger [logger_debugger_launcher] level: TRACE -handlers: +handlers: qualname: robotcode.debugger.launcher [logger_asyncio] level: TRACE -handlers: +handlers: qualname: asyncio [logger_robotcode_utils] level: TRACE -handlers: +handlers: qualname: robotcode.utils [logger_diagnostics] level: TRACE -handlers: +handlers: qualname: robotcode.language_server.common.parts.diagnostics [logger_robot_diagnostics] level: TRACE -handlers: +handlers: qualname: robotcode.language_server.robotframework.parts.diagnostics [logger_robocop_diagnostics] level: TRACE -handlers: +handlers: qualname: robotcode.language_server.robotframework.parts.robocop_diagnostics [logger_document] level: TRACE -handlers: +handlers: qualname: robotcode.language_server.common.text_document [logger_discovering] level: TRACE -handlers: +handlers: qualname: robotcode.language_server.robotframework.parts.discovering - diff --git a/poetry.lock b/poetry.lock index 10da30481..4ce20bf95 100644 --- a/poetry.lock +++ b/poetry.lock @@ -61,20 +61,6 @@ category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -[[package]] -name = "coloredlogs" -version = "15.0.1" -description = "Colored terminal output for Python's logging module" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[package.dependencies] -humanfriendly = ">=9.1" - -[package.extras] -cron = ["capturer (>=2.4)"] - [[package]] name = "commonmark" version = "0.9.1" @@ -182,17 +168,6 @@ python-versions = ">=3.7" [package.dependencies] gitdb = ">=4.0.1,<5" -[[package]] -name = "humanfriendly" -version = "10.0" -description = "Human friendly output for text interfaces using Python" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[package.dependencies] -pyreadline3 = {version = "*", markers = "sys_platform == \"win32\" and python_version >= \"3.8\""} - [[package]] name = "identify" version = "2.5.8" @@ -410,14 +385,6 @@ python-versions = ">=3.6.8" [package.extras] diagrams = ["jinja2", "railroad-diagrams"] -[[package]] -name = "pyreadline3" -version = "3.4.1" -description = "A python implementation of GNU readline." -category = "dev" -optional = false -python-versions = "*" - [[package]] name = "pytest" version = "7.2.0" @@ -738,7 +705,7 @@ testing = ["coverage (>=6.2)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7 [metadata] lock-version = "1.1" python-versions = "^3.8" -content-hash = "3c1dd418419a2a9fd24566a462eaefb355d7a55c877e9d846f9a53c02a70fb91" +content-hash = "c330e8c1c9c414a0a0c80ec57ff749171d9a0e263a6f9913974eebc6ce882cb7" [metadata.files] attrs = [ @@ -746,14 +713,23 @@ attrs = [ {file = "attrs-22.1.0.tar.gz", hash = "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6"}, ] black = [ + {file = "black-22.10.0-1fixedarch-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:5cc42ca67989e9c3cf859e84c2bf014f6633db63d1cbdf8fdb666dcd9e77e3fa"}, + {file = "black-22.10.0-1fixedarch-cp311-cp311-macosx_11_0_x86_64.whl", hash = "sha256:5d8f74030e67087b219b032aa33a919fae8806d49c867846bfacde57f43972ef"}, + {file = "black-22.10.0-1fixedarch-cp37-cp37m-macosx_10_16_x86_64.whl", hash = "sha256:197df8509263b0b8614e1df1756b1dd41be6738eed2ba9e9769f3880c2b9d7b6"}, + {file = "black-22.10.0-1fixedarch-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:2644b5d63633702bc2c5f3754b1b475378fbbfb481f62319388235d0cd104c2d"}, + {file = "black-22.10.0-1fixedarch-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:e41a86c6c650bcecc6633ee3180d80a025db041a8e2398dcc059b3afa8382cd4"}, + {file = "black-22.10.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2039230db3c6c639bd84efe3292ec7b06e9214a2992cd9beb293d639c6402edb"}, {file = "black-22.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14ff67aec0a47c424bc99b71005202045dc09270da44a27848d534600ac64fc7"}, {file = "black-22.10.0-cp310-cp310-win_amd64.whl", hash = "sha256:819dc789f4498ecc91438a7de64427c73b45035e2e3680c92e18795a839ebb66"}, + {file = "black-22.10.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5b9b29da4f564ba8787c119f37d174f2b69cdfdf9015b7d8c5c16121ddc054ae"}, {file = "black-22.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8b49776299fece66bffaafe357d929ca9451450f5466e997a7285ab0fe28e3b"}, {file = "black-22.10.0-cp311-cp311-win_amd64.whl", hash = "sha256:21199526696b8f09c3997e2b4db8d0b108d801a348414264d2eb8eb2532e540d"}, {file = "black-22.10.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1e464456d24e23d11fced2bc8c47ef66d471f845c7b7a42f3bd77bf3d1789650"}, {file = "black-22.10.0-cp37-cp37m-win_amd64.whl", hash = "sha256:9311e99228ae10023300ecac05be5a296f60d2fd10fff31cf5c1fa4ca4b1988d"}, + {file = "black-22.10.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:fba8a281e570adafb79f7755ac8721b6cf1bbf691186a287e990c7929c7692ff"}, {file = "black-22.10.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:915ace4ff03fdfff953962fa672d44be269deb2eaf88499a0f8805221bc68c87"}, {file = "black-22.10.0-cp38-cp38-win_amd64.whl", hash = "sha256:444ebfb4e441254e87bad00c661fe32df9969b2bf224373a448d8aca2132b395"}, + {file = "black-22.10.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:974308c58d057a651d182208a484ce80a26dac0caef2895836a92dd6ebd725e0"}, {file = "black-22.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72ef3925f30e12a184889aac03d77d031056860ccae8a1e519f6cbb742736383"}, {file = "black-22.10.0-cp39-cp39-win_amd64.whl", hash = "sha256:432247333090c8c5366e69627ccb363bc58514ae3e63f7fc75c54b1ea80fa7de"}, {file = "black-22.10.0-py3-none-any.whl", hash = "sha256:c957b2b4ea88587b46cf49d1dc17681c1e672864fd7af32fc1e9664d572b3458"}, @@ -771,10 +747,6 @@ colorama = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] -coloredlogs = [ - {file = "coloredlogs-15.0.1-py2.py3-none-any.whl", hash = "sha256:612ee75c546f53e92e70049c9dbfcc18c935a2b9a53b66085ce9ef6a6e5c0934"}, - {file = "coloredlogs-15.0.1.tar.gz", hash = "sha256:7c991aa71a4577af2f82600d8f8f3a89f936baeaf9b50a9c197da014e5bf16b0"}, -] commonmark = [ {file = "commonmark-0.9.1-py2.py3-none-any.whl", hash = "sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9"}, {file = "commonmark-0.9.1.tar.gz", hash = "sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"}, @@ -879,10 +851,6 @@ gitpython = [ {file = "GitPython-3.1.29-py3-none-any.whl", hash = "sha256:41eea0deec2deea139b459ac03656f0dd28fc4a3387240ec1d3c259a2c47850f"}, {file = "GitPython-3.1.29.tar.gz", hash = "sha256:cc36bfc4a3f913e66805a28e84703e419d9c264c1077e537b54f0e1af85dbefd"}, ] -humanfriendly = [ - {file = "humanfriendly-10.0-py2.py3-none-any.whl", hash = "sha256:1697e1a8a8f550fd43c2865cd84542fc175a61dcb779b6fee18cf6b6ccba1477"}, - {file = "humanfriendly-10.0.tar.gz", hash = "sha256:6b0b831ce8f15f7300721aa49829fc4e83921a9a301cc7f606be6686a2288ddc"}, -] identify = [ {file = "identify-2.5.8-py2.py3-none-any.whl", hash = "sha256:48b7925fe122720088aeb7a6c34f17b27e706b72c61070f27fe3789094233440"}, {file = "identify-2.5.8.tar.gz", hash = "sha256:7a214a10313b9489a0d61467db2856ae8d0b8306fc923e03a9effa53d8aedc58"}, @@ -1029,10 +997,6 @@ pyparsing = [ {file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"}, {file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"}, ] -pyreadline3 = [ - {file = "pyreadline3-3.4.1-py3-none-any.whl", hash = "sha256:b0efb6516fd4fb07b45949053826a62fa4cb353db5be2bbb4a7aa1fdd1e345fb"}, - {file = "pyreadline3-3.4.1.tar.gz", hash = "sha256:6f3d1f7b8a31ba32b73917cefc1f28cc660562f39aea8646d30bd6eff21f7bae"}, -] pytest = [ {file = "pytest-7.2.0-py3-none-any.whl", hash = "sha256:892f933d339f068883b6fd5a459f03d85bfcb355e4981e146d2c7616c21fef71"}, {file = "pytest-7.2.0.tar.gz", hash = "sha256:c4014eb40e10f11f355ad4e3c2fb2c6c6d1919c73f3b5a433de4708202cade59"}, @@ -1077,6 +1041,13 @@ pyyaml = [ {file = "PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"}, {file = "PyYAML-6.0-cp310-cp310-win32.whl", hash = "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513"}, {file = "PyYAML-6.0-cp310-cp310-win_amd64.whl", hash = "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a"}, + {file = "PyYAML-6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d4b0ba9512519522b118090257be113b9468d804b19d63c71dbcf4a48fa32358"}, + {file = "PyYAML-6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:81957921f441d50af23654aa6c5e5eaf9b06aba7f0a19c18a538dc7ef291c5a1"}, + {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:afa17f5bc4d1b10afd4466fd3a44dc0e245382deca5b3c353d8b757f9e3ecb8d"}, + {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dbad0e9d368bb989f4515da330b88a057617d16b6a8245084f1b05400f24609f"}, + {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:432557aa2c09802be39460360ddffd48156e30721f5e8d917f01d31694216782"}, + {file = "PyYAML-6.0-cp311-cp311-win32.whl", hash = "sha256:bfaef573a63ba8923503d27530362590ff4f576c626d86a9fed95822a8255fd7"}, + {file = "PyYAML-6.0-cp311-cp311-win_amd64.whl", hash = "sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf"}, {file = "PyYAML-6.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86"}, {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f"}, {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92"}, diff --git a/pyproject.toml b/pyproject.toml index c6204d1be..599fa21b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,6 @@ flake8 = "*" black = "*" pep8-naming = "*" debugpy = "*" -coloredlogs = "*" GitPython = "^3.1.27" semantic-version = "^2.9.0" pre-commit = "^2.17.0" @@ -163,7 +162,6 @@ module = [ "robot.*", "robotremoteserver.*", "debugpy.*", - "coloredlogs.*", "robotidy.*", "robocop.*", ] diff --git a/robotcode/debugger/__main__.py b/robotcode/debugger/__main__.py index e08c7a8f7..951f85aba 100644 --- a/robotcode/debugger/__main__.py +++ b/robotcode/debugger/__main__.py @@ -311,7 +311,6 @@ def main() -> None: parser.add_argument("-n", "--no-debug", action="store_true", help="disable debugging") parser.add_argument("--debug-asyncio", action="store_true", help="enable async io debugging messages") parser.add_argument("--log-asyncio", action="store_true", help="show asyncio log messages") - parser.add_argument("--log-colored", action="store_true", help="colored output for logs") parser.add_argument("--log-config", default=None, help="reads logging configuration from file", metavar="FILE") parser.add_argument("--log-file", default=None, help="enables logging to file", metavar="FILE") parser.add_argument("--log-level", default="WARNING", help="sets the overall log level", metavar="LEVEL") @@ -378,18 +377,7 @@ def main() -> None: else: log_level = logging._checkLevel(args.log_level) if args.log else logging.WARNING # type: ignore - log_initialized = False - if args.log_colored: - try: - import coloredlogs - - coloredlogs.install(level=log_level) - log_initialized = True - except ImportError: - pass - - if not log_initialized: - logging.basicConfig(level=log_level, format="%(name)s:%(levelname)s: %(message)s") + logging.basicConfig(level=log_level, format="%(name)s:%(levelname)s: %(message)s") if args.log_file is not None: _logger.logger.addHandler(get_log_handler(args.log_file)) diff --git a/robotcode/debugger/launcher/__main__.py b/robotcode/debugger/launcher/__main__.py index 8742dc005..02da51f98 100644 --- a/robotcode/debugger/launcher/__main__.py +++ b/robotcode/debugger/launcher/__main__.py @@ -82,7 +82,6 @@ def main() -> None: parser.add_argument("--log-debugger-launcher", action="store_true", help="show debugger launcher log messages") parser.add_argument("--debug-asyncio", action="store_true", help="enable async io debugging messages") parser.add_argument("--log-asyncio", action="store_true", help="show asyncio log messages") - parser.add_argument("--log-colored", action="store_true", help="colored output for logs") parser.add_argument("--log-config", default=None, help="reads logging configuration from file", metavar="FILE") parser.add_argument("--log-file", default=None, help="enables logging to file", metavar="FILE") parser.add_argument("--log-level", default="WARNING", help="sets the overall log level", metavar="LEVEL") @@ -124,18 +123,7 @@ def main() -> None: else: log_level = logging._checkLevel(args.log_level) if args.log else logging.WARNING # type: ignore - log_initialized = False - if args.log_colored: - try: - import coloredlogs - - coloredlogs.install(level=log_level) - log_initialized = True - except ImportError: - pass - - if not log_initialized: - logging.basicConfig(level=log_level, format="%(name)s:%(levelname)s: %(message)s") + logging.basicConfig(level=log_level, format="%(name)s:%(levelname)s: %(message)s") if args.log_file is not None: _logger.logger.addHandler(get_log_handler(args.log_file)) diff --git a/robotcode/language_server/__main__.py b/robotcode/language_server/__main__.py index 442db32c5..a08b8f8ec 100644 --- a/robotcode/language_server/__main__.py +++ b/robotcode/language_server/__main__.py @@ -6,7 +6,7 @@ import sys from logging.handlers import RotatingFileHandler from pathlib import Path -from typing import Any, Optional +from typing import Optional __file__ = os.path.abspath(__file__) if __file__.endswith((".pyc", ".pyo")): @@ -112,7 +112,6 @@ def create_parser() -> argparse.ArgumentParser: ) result.add_argument("--debug-asyncio", action="store_true", help="enable async io debugging messages") result.add_argument("--log-asyncio", action="store_true", help="show asyncio log messages") - result.add_argument("--log-colored", action="store_true", help="colored output for logs") result.add_argument("--log-config", default=None, help="reads logging configuration from file", metavar="FILE") result.add_argument("--log-file", default=None, help="enables logging to file", metavar="FILE") result.add_argument("--log-level", default="WARNING", help="sets the overall log level", metavar="LEVEL") @@ -128,29 +127,13 @@ def create_parser() -> argparse.ArgumentParser: return result -def init_colored_logs(log_level: Any) -> bool: - try: - import coloredlogs - - coloredlogs.install(level=log_level) - except ImportError: - return False - - return True - - DEFAULT_LOG_LEVEL = logging.ERROR def init_logging(args: argparse.Namespace) -> None: log_level = logging._checkLevel(args.log_level) if args.log else logging.WARNING # type: ignore - log_initialized = False - if args.log_colored: - log_initialized = init_colored_logs(log_level) - - if not log_initialized: - logging.basicConfig(level=log_level, format="%(name)s:%(levelname)s: %(message)s") + logging.basicConfig(level=log_level, format="%(name)s:%(levelname)s: %(message)s") if args.log_file is not None: _logger.logger.addHandler(get_log_handler(args.log_file)) diff --git a/robotcode/utils/async_tools.py b/robotcode/utils/async_tools.py index d06995810..cb814e603 100644 --- a/robotcode/utils/async_tools.py +++ b/robotcode/utils/async_tools.py @@ -481,7 +481,7 @@ async def acquire(self) -> bool: def aaa() -> None: warnings.warn(f"Lock takes to long {threading.current_thread()}") - h = fut.get_loop().call_later(60, aaa) + h = fut.get_loop().call_later(120, aaa) await fut diff --git a/robotcode/utils/logging.py b/robotcode/utils/logging.py index 46704ed1c..bd9cb9f7d 100644 --- a/robotcode/utils/logging.py +++ b/robotcode/utils/logging.py @@ -181,7 +181,7 @@ def log( **kwargs: Any, ) -> None: if self.is_enabled_for(level) and condition is not None and condition() or condition is None: - self.logger.log(level, msg() if callable(msg) else msg, *args, stacklevel=stacklevel, **kwargs) + return self.logger.log(level, msg() if callable(msg) else msg, *args, stacklevel=stacklevel, **kwargs) def debug( self, @@ -191,7 +191,7 @@ def debug( stacklevel: int = 3, **kwargs: Any, ) -> None: - self.log(logging.DEBUG, msg, condition, *args, stacklevel=stacklevel, **kwargs) + return self.log(logging.DEBUG, msg, condition, *args, stacklevel=stacklevel, **kwargs) def info( self, @@ -201,7 +201,7 @@ def info( stacklevel: int = 3, **kwargs: Any, ) -> None: - self.log(logging.INFO, msg, condition, *args, stacklevel=stacklevel, **kwargs) + return self.log(logging.INFO, msg, condition, *args, stacklevel=stacklevel, **kwargs) def warning( self, @@ -211,7 +211,7 @@ def warning( stacklevel: int = 3, **kwargs: Any, ) -> None: - self.log(logging.WARNING, msg, condition, *args, stacklevel=stacklevel, **kwargs) + return self.log(logging.WARNING, msg, condition, *args, stacklevel=stacklevel, **kwargs) def error( self, @@ -221,7 +221,7 @@ def error( stacklevel: int = 3, **kwargs: Any, ) -> None: - self.log(logging.ERROR, msg, condition, *args, stacklevel=stacklevel, **kwargs) + return self.log(logging.ERROR, msg, condition, *args, stacklevel=stacklevel, **kwargs) def trace( self, @@ -231,7 +231,7 @@ def trace( stacklevel: int = 3, **kwargs: Any, ) -> None: - self.log(TRACE, msg, condition, *args, stacklevel=stacklevel, **kwargs) + return self.log(TRACE, msg, condition, *args, stacklevel=stacklevel, **kwargs) def exception( self, @@ -248,7 +248,7 @@ def exception( s = type(msg).__qualname__ if sm: s += ": " + sm - self.log( + return self.log( logging.ERROR if level is None else level, s, condition, @@ -258,7 +258,7 @@ def exception( **kwargs, ) else: - self.log( + return self.log( logging.ERROR if level is None else level, msg, condition, @@ -276,7 +276,7 @@ def critical( stacklevel: int = 3, **kwargs: Any, ) -> None: - self.log(logging.CRITICAL, msg, condition, *args, stacklevel=stacklevel, **kwargs) + return self.log(logging.CRITICAL, msg, condition, *args, stacklevel=stacklevel, **kwargs) def is_enabled_for(self, level: int) -> bool: return self.logger.isEnabledFor(level)