| 1 | """ |
| 2 | Logistro wraps `logging` for added defaults and subprocess logging. |
| 3 | |
| 4 | Typical usage: |
| 5 | |
| 6 | ```python |
| 7 | |
| 8 | import logistro |
| 9 | logger = logistro.getLogger(__name__) |
| 10 | logger.debug2("This will be printed more informatively") |
| 11 | |
| 12 | # Advanced |
| 13 | pipe, logger = logistro.getPipeLogger(__name__) |
| 14 | # Pipe all stderr to our logger |
| 15 | subprocess.Popen(process_name, stderr=pipe) |
| 16 | |
| 17 | # Eventually close the pipe in case other process doesn't |
| 18 | subprocess.wait() |
| 19 | os.close(pipe) |
| 20 | ``` |
| 21 | """ |
| 22 | |
| 23 | import logging |
| 24 | |
| 25 | from ._api import ( |
| 26 | DEBUG2, |
| 27 | betterConfig, |
| 28 | describe_logging, |
| 29 | getLogger, |
| 30 | getPipeLogger, |
| 31 | human_formatter, |
| 32 | set_human, |
| 33 | set_structured, |
| 34 | structured_formatter, |
| 35 | ) |
| 36 | from ._args import parsed, parser, remaining_args |
| 37 | |
| 38 | CRITICAL = logging.CRITICAL |
| 39 | """Equal to logging.CRITICAL level.""" |
| 40 | |
| 41 | DEBUG = logging.DEBUG |
| 42 | """Equal to logging.DEBUG level.""" |
| 43 | |
| 44 | ERROR = logging.ERROR |
| 45 | """Equal to logging.ERROR level.""" |
| 46 | |
| 47 | INFO = logging.INFO |
| 48 | """Equal to logging.INFO level.""" |
| 49 | |
| 50 | WARNING = logging.WARNING |
| 51 | """Equal to logging.WARNING level.""" |
| 52 | |
| 53 | __all__ = [ |
| 54 | "CRITICAL", |
| 55 | "DEBUG", |
| 56 | "DEBUG2", |
| 57 | "ERROR", |
| 58 | "INFO", |
| 59 | "WARNING", |
| 60 | "betterConfig", |
| 61 | "describe_logging", |
| 62 | "getLogger", |
| 63 | "getPipeLogger", |
| 64 | "human_formatter", |
| 65 | "parsed", |
| 66 | "parser", |
| 67 | "remaining_args", |
| 68 | "set_human", |
| 69 | "set_structured", |
| 70 | "structured_formatter", |
| 71 | ] |