pub struct RunLog { /* private fields */ }Expand description
All the log messages for a CI run.
The default version collects messages, but doesn’t write them. If the output is set later, the collected messages get written there.
Implementations§
Source§impl RunLog
impl RunLog
Sourcepub fn to_named_file(
&mut self,
filename: impl AsRef<Path>,
) -> Result<(), RunLogError>
pub fn to_named_file( &mut self, filename: impl AsRef<Path>, ) -> Result<(), RunLogError>
Change RunLog so that further log messages are written to a
named file.
Sourcepub fn msgs(&self) -> &[RunLogMessage]
pub fn msgs(&self) -> &[RunLogMessage]
All messages.
Sourcepub fn push(&mut self, msg: RunLogMessage)
pub fn push(&mut self, msg: RunLogMessage)
Append a message to the run log.
Sourcepub fn write(&mut self, msg: &RunLogMessage)
pub fn write(&mut self, msg: &RunLogMessage)
Output a message to stderr.
Sourcepub fn read_raw(reader: impl Read) -> Result<Self, RunLogError>
pub fn read_raw(reader: impl Read) -> Result<Self, RunLogError>
Load run log file a reader. This reads the output from the “run log” serial port of QEMU and extracts the JSON lines from that for parsing.
Sourcepub fn from_raw(buf: Vec<u8>) -> Result<Self, RunLogError>
pub fn from_raw(buf: Vec<u8>) -> Result<Self, RunLogError>
Load run log from in-memory raw data. This parses the output to extract JSON Lihes.
Sourcepub fn read_jsonl(reader: impl Read) -> Result<Self, RunLogError>
pub fn read_jsonl(reader: impl Read) -> Result<Self, RunLogError>
Load run log file a reader. This reads pure JSON Lines run log.
Sourcepub fn parse_jsonl(data: Vec<u8>) -> Result<Self, RunLogError>
pub fn parse_jsonl(data: Vec<u8>) -> Result<Self, RunLogError>
Parse JSON run log from memory.
Source§impl RunLog
impl RunLog
pub fn debug(&mut self, source: RunLogSource, msg: impl Into<String>)
pub fn ambient_starts<N: Into<String>, V: Into<String>>( &mut self, source: RunLogSource, name: N, version: V, )
pub fn ambient_ends_successfully(&mut self, source: RunLogSource)
pub fn ambient_ends_in_failure(&mut self, source: RunLogSource)
pub fn ambient_runtime_config(&mut self, source: RunLogSource, config: &Config)
pub fn run_ci(&mut self, source: RunLogSource, project_name: impl Into<String>)
pub fn skip_ci(&mut self, source: RunLogSource, project_name: impl Into<String>)
pub fn executor_starts( &mut self, source: RunLogSource, name: impl Into<String>, version: impl Into<String>, )
pub fn executor_ends_successfully(&mut self, source: RunLogSource)
pub fn executor_ends_in_failure(&mut self, source: RunLogSource, exit_code: i32)
Sourcepub fn runnable_plan(&mut self, source: RunLogSource, plan: &RunnablePlan)
pub fn runnable_plan(&mut self, source: RunLogSource, plan: &RunnablePlan)
Log runnable plan at start of execution.
Sourcepub fn execute_action(&mut self, source: RunLogSource, action: &RunnableAction)
pub fn execute_action(&mut self, source: RunLogSource, action: &RunnableAction)
Execute an action.
Sourcepub fn action_succeeded(
&mut self,
source: RunLogSource,
action: &RunnableAction,
)
pub fn action_succeeded( &mut self, source: RunLogSource, action: &RunnableAction, )
Action succeded.
Sourcepub fn action_failed(&mut self, source: RunLogSource, action: &RunnableAction)
pub fn action_failed(&mut self, source: RunLogSource, action: &RunnableAction)
Action failed.
pub fn deb_get(&mut self, source: RunLogSource, packages: &[Needed])
Sourcepub fn npm_get_succeeded(&mut self, source: RunLogSource)
pub fn npm_get_succeeded(&mut self, source: RunLogSource)
npm_get action succeeded.
Sourcepub fn npm_get_failed(&mut self, log_source: RunLogSource, err: &NpmError)
pub fn npm_get_failed(&mut self, log_source: RunLogSource, err: &NpmError)
npm_get action failed.
Sourcepub fn custom_action_starts(
&mut self,
log_source: RunLogSource,
source: PathBuf,
custom: Custom,
exe: PathBuf,
exe_exists: bool,
)
pub fn custom_action_starts( &mut self, log_source: RunLogSource, source: PathBuf, custom: Custom, exe: PathBuf, exe_exists: bool, )
Custom action starts.
Sourcepub fn custom_action_output(
&mut self,
source: RunLogSource,
stdout: Vec<u8>,
stderr: Vec<u8>,
)
pub fn custom_action_output( &mut self, source: RunLogSource, stdout: Vec<u8>, stderr: Vec<u8>, )
CUstom action succeeded.
Sourcepub fn plan_succeeded(&mut self, source: RunLogSource)
pub fn plan_succeeded(&mut self, source: RunLogSource)
All actions in plan succeded.
Sourcepub fn start_program(&mut self, source: RunLogSource, cmd: &Command)
pub fn start_program(&mut self, source: RunLogSource, cmd: &Command)
Start a program.
Sourcepub fn program_succeeded(&mut self, source: RunLogSource, output: &Output)
pub fn program_succeeded(&mut self, source: RunLogSource, output: &Output)
Program succeeded.
Sourcepub fn program_failed(&mut self, source: RunLogSource, err: &CommandError)
pub fn program_failed(&mut self, source: RunLogSource, err: &CommandError)
Program failed.
Sourcepub fn start_qemu(&mut self, source: RunLogSource, cmd: &Command)
pub fn start_qemu(&mut self, source: RunLogSource, cmd: &Command)
Start a program.
Sourcepub fn qemu_succeeded(&mut self, source: RunLogSource, output: &Output)
pub fn qemu_succeeded(&mut self, source: RunLogSource, output: &Output)
Program succeeded.
Sourcepub fn qemu_failed(&mut self, source: RunLogSource, err: &CommandError)
pub fn qemu_failed(&mut self, source: RunLogSource, err: &CommandError)
Program failed.