pyapp-org/pyapp

Enable no logging

Closed this issue · 1 comments

Hi Tim, great app! I'd like to ask for a new feature. I'm writing a Linux shell utility using PyApp and I'd like it not to output the initial two lines before logging is setup, see sample below:

2020-04-17 10:27:29,058 INFO pyapp.app Starting myapp.exe version 1.0.0 - MyApp CLI
2020-04-17 10:27:29,061 INFO pyapp.conf Loading settings from: python:myapp.default_settings

Is there any way to achieve this? Thanks for your help.

This brings up a few thoughts:

  1. Provide a DEBUG message on first startup
  2. Write the up version information after logger is initialised from settings (if logging to a file this is better as this information would then be written into the file)
  3. Capture all log events prior to initialisation
    • Write captured messages into log after initialisation.
    • Report any info messages as DEBUG prior to initialisation so they can still be accessed if there is a failure during startup

Reporting version information is important during startup, also do not want to lose any critical information at startup time.