mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-23 19:11:14 +01:00
1c24f0054a
* Make logging code self-contained. Rewrite logging code to use python's builting QueueListener, effectively moving the logging process into a thread of the Frigate app. Also, wrap this behaviour in a easy-to-use context manager to encourage some consistency. * Fixed typing errors * Remove todo note from log filter Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com> * Do not access log record's msg directly * Clear all root handlers before starting app --------- Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
29 lines
487 B
Python
29 lines
487 B
Python
import faulthandler
|
|
import logging
|
|
import threading
|
|
|
|
from flask import cli
|
|
|
|
from frigate.app import FrigateApp
|
|
|
|
|
|
def main() -> None:
|
|
faulthandler.enable()
|
|
|
|
# Clear all existing handlers.
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
handlers=[],
|
|
force=True,
|
|
)
|
|
|
|
threading.current_thread().name = "frigate"
|
|
cli.show_server_banner = lambda *x: None
|
|
|
|
# Run the main application.
|
|
FrigateApp().start()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|