hbp_nrp_commons package¶
This package contains functionality shared across the NRP backend
-
hbp_nrp_commons.
get_python_interpreter
()[source]¶ When started through uWSGI, sys.executable returns the uwsgi executable and not the python interpreter (see here for details).
-
hbp_nrp_commons.
set_up_logger
(name: Optional[str] = None, logfile_name: Optional[str] = None, log_format: str = '%(asctime)s [%(threadName)-12.12s] [%(name)-12.12s] [%(levelname)s] %(message)s', level: Union[int, str] = 20) → logging.Logger[source]¶ Configure the logger named
name
. If name isNone
, return the root logger.- Parameters
name – The name of the logger to be set up. None means root logger (same as logging.getLogger)
logfile_name – name of the file created to collect logs. None means stdout.
level – The logger level. Defaults to INFO.
- Returns
the logger with the specified name configured as required.