log_setup.py¶
This module is used to set up and manipulate the logging configuration for
utilities like debug mode.
Functionality overview¶
By way of hutch_python.ipython_log.IPythonLogger, log the following
to {{LOG_DIR}}/year_month/user_timestamp.log:
- All IPython input 
- Any DEBUG message (well, _level 5+_) - Exception: hushed loggers, listed below - Exception: Only whitelisted ophyd object logs, down to DEBUG level (or 5) 
Log to both the above file and console:
- Any INFO, WARNING, ERROR, CRITICAL messages 
- By way of - pcdsutils.log.install_log_warning_handler, log all calls to- warnings.warnat WARNING level
console exceptions:
- ophydobject INFO should be treated as DEBUG 
- loggers which exceed the configurable log rate thresholds should be filtered out with an accompanying initial notification 
- repeat warning logs and all callback exception logs should be treated as DEBUG instead of as WARNING and ERROR respectively 
- Hush entirely - neither the file nor the console should see:
- ophyd.event_dispatcher 
- parso 
- pyPDB.dbd.yacc 
 
| Sets up the  | |
| Get the path to the current debug log file | |
| Get the currently configured logging path. | |
| Helper function to find the console  | |
| Helper function to get the console's log level. | |
| Helper function to get the console's log level name. | |
| Helper function to set the console's log level. | |
| Enable, disable, or check if we're in debug mode. | |
| Context manager for running a block of code in  | |
| Wrapper for running a function in  | |
| A logging filter that limits log messages to a specific object or objects. | |
| Configure a custom logging handler on the specified object(s), and record log messages to files and (optionally) to the console. | |
| Return to default logging behavior and do not treat objects specially. |