#1 fix and #3 fix for edge

This commit is contained in:
2024-11-23 13:22:49 +01:00
parent edcfa6110a
commit 77fbcb9b31
4 changed files with 20 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
"""
This is the PyJail, a jailing tool for running Python apps in a sandboxed environment.
Version: edge0004-base0.2.1
Version: edge0005-base0.2.1
"""
import os
import time
@@ -58,10 +58,10 @@ class PyJail:
msg = f"[{time.time}] [{caller}] [{log_level}] {message}"
with open(self.fs("/proc/klog"), "a+") as f:
f.write(msg)
if emit is True and (log_level.upper() == "ERROR" or log_level.upper() == "CRITICAL"):
if emit is True and log_level.upper() == "CRITICAL":
print(msg)
elif emit is True:
print(message)
return 0
def fs(self, check_path=None, resolve_symlinks=True):
@@ -137,7 +137,7 @@ class PyJail:
"""
Returns the kernel version
"""
return "edge0004-base0.2.1"
return "edge0005-base0.2.1"
def netsock(self, ip, port, mode, msg):
"""