Merge from old Gitea
This commit is contained in:
26
examples/logs.py
Normal file
26
examples/logs.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import asyncio
|
||||
import time
|
||||
from esasdk import Machine
|
||||
|
||||
async def main():
|
||||
# Connect to a machine
|
||||
machine = Machine("ws://localhost:5424")
|
||||
await machine.connect()
|
||||
|
||||
# Get machine logs
|
||||
logs = await machine.log()
|
||||
print(f"Machine logs: {logs}")
|
||||
|
||||
# Get machine log state - not implemented in cpp yet.
|
||||
#log = await machine.log('GameBase')
|
||||
#print(f"Machine logs: {log}")
|
||||
|
||||
# Set machine log state - TODO: reply message is not implemented in cpp yet.
|
||||
log = await machine.log_enabled('GameBase', True)
|
||||
#print(f"Machine logs: {log}")
|
||||
|
||||
# Close connection
|
||||
await machine.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user