arxiv.canonical.log.log module
Provides the write log for the canonical record.
-
class
arxiv.canonical.log.log.
Log
(path)[source]
Bases: object
Action log for a canonical agent.
-
property
current_log_path
The path to the current log file.
- Return type
str
-
log_failure
(event_id, action, message='')[source]
Log a failed action.
- Return type
LogEntry
-
log_success
(event_id, action, message='')[source]
Log a successful action.
- Return type
LogEntry
-
read_all
()[source]
- Return type
Iterable
[LogEntry
]
-
read_last_entry
()[source]
Read the last entry in the log.
- Return type
LogEntry
-
read_last_succeeded
()[source]
Read the last SUCCEEDED entry in the log.
- Return type
Optional
[LogEntry
]
-
write
(event_id, action, state, message)[source]
Write a log entry.
- Return type
LogEntry
-
class
arxiv.canonical.log.log.
LogEntry
(timestamp, event_id, action, state, message)[source]
Bases: object
-
action
= None
Action being performed by the agent.
-
event_id
= None
Identifier of the event being handled.
-
classmethod
from_repr
(repr)[source]
- Return type
LogEntry
-
message
= None
Additional unstructured information about the action.
-
state
= None
Outcome of the action.
-
timestamp
= None
The time of the log entry.