mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-12-04 04:28:26 +01:00
test for log since last boot
This commit is contained in:
parent
1f56fa8fe1
commit
4ca441bba3
2 changed files with 17 additions and 2 deletions
|
@ -1,3 +1,3 @@
|
||||||
__version__ = "4.4.1.a4"
|
__version__ = "4.4.1.a5"
|
||||||
__codename__ = "Yeast Starter"
|
__codename__ = "Yeast Starter"
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,22 @@ class SystemController:
|
||||||
output_filename="cbpi4_log.zip"
|
output_filename="cbpi4_log.zip"
|
||||||
|
|
||||||
if logtime == "b":
|
if logtime == "b":
|
||||||
os.system('journalctl -b -u craftbeerpi.service --output cat > {}'.format(fullname))
|
if systemd_available:
|
||||||
|
#os.system('journalctl -b -u craftbeerpi.service --output cat > {}'.format(fullname))
|
||||||
|
j = journal.Reader()
|
||||||
|
j.add_match(_TRANSPORT="kernel")
|
||||||
|
result=[]
|
||||||
|
for entry in j:
|
||||||
|
message=entry['MESSAGE']
|
||||||
|
if message.find("Booting") != -1:
|
||||||
|
result.append(entry['__REALTIME_TIMESTAMP'])
|
||||||
|
j.add_match(_SYSTEMD_UNIT="craftbeerpi.service")
|
||||||
|
j.seek_realtime(result[-1])
|
||||||
|
for entry in j:
|
||||||
|
timestamp=entry['__REALTIME_TIMESTAMP']
|
||||||
|
message=entry['MESSAGE']
|
||||||
|
print(message)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if systemd_available:
|
if systemd_available:
|
||||||
result=[]
|
result=[]
|
||||||
|
|
Loading…
Reference in a new issue