syslog problem

ft <[email protected]>
Newsgroups gmane.os.freebsd.stable
Message-ID <[email protected]>
Hello, 

I have a Python script that writes messages to syslog.

The script works with the print and sleep commands. When I remove the
print and sleep commands, only the first two commands appear in
local5.log file.

=====
#!/usr/bin/env python3.14

import syslog
import os
import sys
import time

FACILITY = syslog.LOG_LOCAL5

def _get_script_name():
    return os.path.basename(sys.argv[0])


def LOG_E(message):
    script_name = _get_script_name()
    formatted_message = f"ERROR: {script_name} {message}"
    syslog.openlog(
        ident=script_name,
        logoption=syslog.LOG_PID,
        facility=FACILITY
    )
    syslog.syslog(syslog.LOG_INFO, formatted_message)
    syslog.closelog()


LOG_E("test_e13aaa")
# print("test_e13")
# time.sleep(1)

LOG_E("test_e23")
# print("test_e23")
# time.sleep(1)

LOG_E("test_e33")
# print("test_e33")
# time.sleep(1)

LOG_E("test_e43")
# print("test_e43")
# time.sleep(1)

LOG_E("test_e53")
# print("test_e53")
# time.sleep(1)

LOG_E("test_e63")
# print("test_e63")
# time.sleep(1)

LOG_E("test_e73")
# print("test_e73")
# time.sleep(1)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.