28 lines
690 B
Python
28 lines
690 B
Python
import sqlite3
|
|
|
|
conn = sqlite3.connect("data/scriptsmanager.db")
|
|
cursor = conn.cursor()
|
|
|
|
# Get the latest execution log (id=32)
|
|
cursor.execute(
|
|
"""
|
|
SELECT id, status, exit_code, command_executed, error_output
|
|
FROM execution_logs
|
|
WHERE id = 32
|
|
"""
|
|
)
|
|
|
|
result = cursor.fetchone()
|
|
if result:
|
|
log_id, status, exit_code, command_executed, error_output = result
|
|
|
|
print(f"=== EXECUTION LOG ID: {log_id} ===")
|
|
print(f"Status: {status}")
|
|
print(f"Exit Code: {exit_code}")
|
|
print(f"Command: {command_executed}")
|
|
print(f'Error: {error_output if error_output else "[No error]"}')
|
|
else:
|
|
print("No log found with id 32")
|
|
|
|
conn.close()
|