feat: Add dummy main application script
The script uses the logger system and prints an string. You can try the programm call with and without `-vv`so see the differences of logging levels.
This commit is contained in:
30
src/revpi_middleware/main_application.py
Normal file
30
src/revpi_middleware/main_application.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# SPDX-FileCopyrightText: 2025 KUNBUS GmbH
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
"""Main application of revpi-middleware daemon."""
|
||||
from logging import getLogger
|
||||
|
||||
from . import proginit as pi
|
||||
|
||||
log = getLogger(__name__)
|
||||
|
||||
|
||||
def main() -> int:
|
||||
"""
|
||||
This is the main entry point.
|
||||
|
||||
We do not pack this to a 'if __name__ == "__main__"' thing to be able to
|
||||
call this function from different places. The __main__ module and entry
|
||||
points in the setup.py will call this function and linke to have an int
|
||||
as return value for the exit code.
|
||||
"""
|
||||
log.debug("Enter main() function")
|
||||
|
||||
log.warning(f"This is the empty '{pi.programname}' application so far")
|
||||
|
||||
log.debug("Leave main() function")
|
||||
|
||||
# Finally, call the cleanup function of proginit to flush all log buffers.
|
||||
pi.cleanup()
|
||||
|
||||
return 0
|
||||
Reference in New Issue
Block a user