if level > LOG_LEVEL:
return
try:
fd = os.open(LOG_FILE, os.O_WRONLY | os.O_CREAT | os.O_APPEND, 0o600)
if not msg.endswith('\n'):
msg += '\n'
if level > LOG_LEVEL:
return
try:
fd = os.open(LOG_FILE, os.O_WRONLY | os.O_CREAT | os.O_APPEND, 0o600)
if not msg.endswith('\n'):
msg += '\n'