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:
parent
c283e542e3
commit
374ecafb53
8 changed files with 47 additions and 20 deletions
|
@ -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
|
||||
|
|
|
@ -192,7 +192,11 @@ HPI comes with a command line tool that can help you detect potential issues. Ru
|
|||
|
||||
If you only have a few modules set up, lots of them will error for you, which is expected, so check the ones you expect to work.
|
||||
|
||||
If you're having issues with ~cachew~ or want to show logs to troubleshoot what may be happening, you can pass the debug flag (e.g., ~hpi --debug doctor my.module_name~) or set the ~HPI_LOGS~ environment variable (e.g., ~HPI_LOGS=debug hpi query my.module_name~) to print all logs, including the ~cachew~ dependencies. ~HPI_LOGS~ could also be used to silence ~info~ logs, like ~HPI_LOGS=warning hpi ...~
|
||||
If you're having issues with ~cachew~ or want to show logs to troubleshoot what may be happening, you can pass the debug flag (e.g., ~hpi --debug doctor my.module_name~) or set the ~LOGGING_LEVEL_HPI~ environment variable (e.g., ~LOGGING_LEVEL_HPI=debug hpi query my.module_name~) to print all logs, including the ~cachew~ dependencies. ~LOGGING_LEVEL_HPI~ could also be used to silence ~info~ logs, like ~LOGGING_LEVEL_HPI=warning hpi ...~
|
||||
|
||||
If you want to enable logs for a particular module, you can use the
|
||||
~LOGGING_LEVEL_~ prefix and then the module name with underscores, like
|
||||
~LOGGING_LEVEL_my_hypothesis=debug hpi query my.hypothesis~
|
||||
|
||||
If you want ~HPI~ to autocomplete the module names for you, this comes with shell completion, see [[../misc/completion/][misc/completion]]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue