From 6a111d62f0f9154d96e94a42bc4e5b6776cc9b5a Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Fri, 15 Nov 2024 10:02:19 +0100 Subject: [PATCH] Map native fatal to critical (#677) Fixes #640 --- CHANGELOG.md | 5 +++++ src/structlog/_native.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9267b458..ea0c0efd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,11 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/ [#669](https://github.com/hynek/structlog/pull/669) +- The native `FilteringBoundLogger.fatal()` method now maps to the critical level, as it does in the standard library. + Note that the level is discouraged to use there, so we recommend to stick to `error()` or `critical()`. + + [#677](https://github.com/hynek/structlog/pull/677) + ## [24.4.0](https://github.com/hynek/structlog/compare/24.3.0...24.4.0) - 2024-07-17 diff --git a/src/structlog/_native.py b/src/structlog/_native.py index a96e6da2..dedf8a6c 100644 --- a/src/structlog/_native.py +++ b/src/structlog/_native.py @@ -202,8 +202,8 @@ async def alog( meths["exception"] = exception meths["aexception"] = aexception - meths["fatal"] = meths["error"] - meths["afatal"] = meths["aerror"] + meths["fatal"] = meths["critical"] + meths["afatal"] = meths["acritical"] meths["warn"] = meths["warning"] meths["awarn"] = meths["awarning"] meths["msg"] = meths["info"]