Skip to content

Commit 887431a

Browse files
committed
Added a conditional check to append "by systemd" to the startup log message when the application is launched via systemd.
1 parent fc6ba14 commit 887431a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/inverter_charge_controller.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class InverterChargeController(LoggerMixin):
2424
def __init__(self):
2525
super().__init__()
2626

27-
self.log.info("Starting application")
27+
started_by_systemd = " by systemd" if "INVOCATION_ID" in os.environ else ""
28+
self.log.info(f"Starting application{started_by_systemd}")
2829

2930
self.timezone = TimeHandler.get_timezone()
3031
self.sems_portal_api_handler = SemsPortalApiHandler()

0 commit comments

Comments
 (0)