Configuration¶
This module generates the “~/.exa” directory where all databases, logs, notebooks, and data reside. This configuration may be altered by editing the items below:
- paths:
- data: Path to the data directory (default ~/.exa/data)
- notebooks: Path to the notebooks directory (default ~/.exa/notebooks)
- log:
- nlogs: Number of log files to rotate
- nbytes: Max log file size (in bytes)
- syslog: System log file path
- dblog: Database log file path (if necessary)
- level: Logging level, 0: normal, 1: extra info, 2: debug
- db:
- uri: String URI for database connection
- update: If 1, refresh static database data (e.g. unit conversions)
- js:
- update: If 1, update JavaScript notebook extensions
Warning
The configuration file (~/.exa/config) should only be altered when no exa notebooks are running (i.e. exa or any of its related packages are imported).
-
exa._config.
save
()[source]¶ Save the configuration file to disk on exit, resetting update flags.
Warning
This is a bit unsafe because we are not guarenteed to hit the updating function during execution (that is what well written tests are for - use mock), but it is advantageous in the case that multiple packages that use exa are running simultaneously.
Exceptions¶
All base level exceptions are defined here.
Logging¶
There are two log files that exa writes to, the system log and the database log. The database log is used when the database backend does not provide its own logging solution.
- Levels:
- 0: default (>= WARNING messages are logged)
- 1: info (>= INFO messages are logged)
- 2: debug (all messages are logged)