diff options
author | Pjotr Prins | 2023-12-03 09:47:38 -0600 |
---|---|---|
committer | Pjotr Prins | 2023-12-03 09:47:38 -0600 |
commit | baeafc5ccc4a9893d22e6629db97720e3fa6d3ae (patch) | |
tree | 3701e477b4643893fbb33495ef64a758bba03de9 /topics/programming/better-logging.gmi | |
parent | aa3d310aa257f0ef0a8636272883c3c4e6855a1c (diff) | |
download | gn-gemtext-baeafc5ccc4a9893d22e6629db97720e3fa6d3ae.tar.gz |
Rename/move
Diffstat (limited to 'topics/programming/better-logging.gmi')
-rw-r--r-- | topics/programming/better-logging.gmi | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/topics/programming/better-logging.gmi b/topics/programming/better-logging.gmi new file mode 100644 index 0000000..dca8c0d --- /dev/null +++ b/topics/programming/better-logging.gmi @@ -0,0 +1,29 @@ +# Improving Logging in GN2 + +## What Are We Trying To Solve? + +We prioritise maintaining user functionality over speed in GN [with time this speed will be improved]. As such we should be pay more attention at not breaking any currently working GN2 functionality. And when/if we do, trouble-shooting should be easy. On this front, one way is to stream-line logging in both GN2/GN3 and make it more script friendly - only report when something fails, not to instrument variables - and in so doing make the process of monitoring easier. + +## Goals + +* Have script-friendly error/info logs. +* Remove noise from GN2. +* Separate logging into different files: error logs, info logs. Add this somewhere with Flask itself instead of re-directing STDOUT to a file. + +### Non-goals + +* Logging in GN3. +* Parsing logs to extract goals. +* Getting rid of "gn.db" global object and in so doing removing "MySqlAlchemy" [that we really shouldn't be using]. +* Adding log messages to existing functions. + +## Actual Design + +* Get rid of "utility.logger" module and replace it with Flask's or Python's in-built logging. +* Configure the logging system to automatically add the module name, line number, time-stamps etc. +* Use a better format for displaying the logs. +* Delete "with Bench..." calls. + +## Resources + +=> https://realpython.com/python-logging/ Logging in Python |