Marcos Dione on Nostr: I almost started bashing (#python'ing?) my head against the desk because I only read ...
I almost started bashing (#python'ing?) my head against the desk because I only read this for the first time ever:
> The functions `debug()`, `info()`, `warning()`, `error()` and `critical()` will call `basicConfig()` automatically if no handlers are defined for the root logger.
I run my code with `pdb` and reached `logging.basicConfig()`'s line `if len(root.handlers) == 0`. It failed, so someone called one of those functions before I called `basicConfig()`. Fixed by `basicConfig()` ASAP.
Published at
2025-11-02 22:49:48 UTCEvent JSON
{
"id": "d68d3a33fcaa206fdc1a36b98e05a7d9aaa24d860060ae963a96ef17b27c7fd1",
"pubkey": "014223f8f8a5ed035e7c51fe9c73da82c0675068963e0790c514205da44fa516",
"created_at": 1762123788,
"kind": 1,
"tags": [
[
"t",
"python"
],
[
"proxy",
"https://en.osm.town/@mdione/115482544610658583",
"web"
],
[
"proxy",
"https://en.osm.town/users/mdione/statuses/115482544610658583",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://en.osm.town/users/mdione/statuses/115482544610658583",
"pink.momostr"
],
[
"-"
]
],
"content": "I almost started bashing (#python'ing?) my head against the desk because I only read this for the first time ever:\n\n\u003e The functions `debug()`, `info()`, `warning()`, `error()` and `critical()` will call `basicConfig()` automatically if no handlers are defined for the root logger.\n\nI run my code with `pdb` and reached `logging.basicConfig()`'s line `if len(root.handlers) == 0`. It failed, so someone called one of those functions before I called `basicConfig()`. Fixed by `basicConfig()` ASAP.",
"sig": "32bd672e91492c9c06ba0697da8b888108e8837f76b3cd6f49cd9906b1ed3b3ba2594f4f0355037c8867d685eab62b637326c5e83e069f2cff99aecaaf9f0046"
}