1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 21:26:44 +02:00

5 Commits

Author SHA1 Message Date
Igor Chubin e82797a39e Format python code using black 2025-07-29 20:07:59 +02:00
Chris eb67a5e0c1 Add aiohttp as a plain text agent 2021-01-31 16:09:42 +00:00
Igor Chubin 4d86f0fb95 Add powershell to PLAIN_TEXT_AGENTS (#273) 2021-01-10 09:50:51 +01:00
Anatoli Babenia fec99a7a54 Properly setup Flask logging to stderr
Sometimes there is nothing, sometimes lines are duplicated.

Duplicated lines problem appears, because Python root logger
handler and Flask's `werkzeug` logger handler both write the
same message. `cheat.sh` is hit, because it sets this root
logging handler.

Normally `werkzeug` doesn't setup its own handler if it sees
that there are some handlers that process its messages. This
in case of `cheat.sh` resulted in no stderr logging at all.
No Exceptions either. Because `werkzeug` catches the
exceptions and logs them.

Hovewer, sometimes `werkzeug` starts too early, befora app
is imported (https://github.com/pallets/werkzeug/issues/1969)
and sets its logger anyway, before the app itself, resulting
in duplicating lines. In that case app root handler needs to
skip lines from `werkzeug`.

Kudos to @brandon-rhodes for `logging_tree` awesomeness
2020-11-17 13:38:16 +03:00
Anatoli Babenia 277b45e83c Decouple Flask app from gevent monkeypatching 2020-11-16 12:02:12 +03:00