Here's one way to do it:I have installed entware and Python on my AC68U.
And this night I learned that I can send logger-events that can be seen in the gui.
Is there a simple way to send them from my Python-scripts as well?
import subprocess
...
subprocess.run("/usr/bin/logger -t 'MyEventLogMsgTag' 'Logging events from my Python script...'", shell=True, check=True)
subprocess.run("grep -i 'MyEventLogMsgTag' /tmp/syslog.log", shell=True)
import subprocess
...
logCmd = '/usr/bin/logger'
logTag = ' -t "MyEventLogMsgTag"'
logMsg = ' "Testing logging from Python..."'
theFullLogCmd = logCmd + logTag + logMsg
subprocess.run(theFullLogCmd, shell=True, check=True)
We use essential cookies to make this site work, and optional cookies to enhance your experience.