my.core.logging: compatibility with HPI_LOGS

re-adds a removed check for HPI_LOGS, add some docs

fix the checks for browserexport/takeout logs to
use the computed level from my.core.logging
This commit is contained in:
Sean Breckenridge 2023-09-06 16:35:26 -07:00 committed by karlicoss
parent ff84d8fc88
commit 2a46341ce2
8 changed files with 47 additions and 20 deletions

View file

@ -233,3 +233,17 @@ The main goals are:
It could be argued that namespace packages and editable installs are a bit complex for a new user to get the hang of, and this is true. But fortunately ~import_source~ means any user just using HPI only needs to follow the instructions when a warning is printed, or peruse the docs here a bit -- there's no need to clone or create your own override to just use the ~all.py~ file.
There's no requirement to use this for individual modules, it just seems to be the best solution we've arrived at so far
* Logging
The ~my.core~ module exports a ~make_logger~ function which works nicely with
~cachew~ and gives you colored logs. You can use it like this:
#+begin_src python
from my.core import make_logger
logger = make_logger(__name__)
# or to set a custom level
logger = make_logger(__name__, level='warning')
#+end_src