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:
Sven Sager
2023-10-03 09:37:33 +02:00
committed by Sven Sager
parent 92666f117d
commit c1bd98c444

View 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