Trace
- class shell_logger.trace.Trace(**kwargs)[source]
Bases:
objectTrace a command run in the underlying shell.
Provides an interface for the
ShellLoggerto run commands with a certain trace (e.g.,straceorltrace).Initialize the
Traceobject.Set up the output file where the trace information will be written.
- command(command)[source]
Get the command to be run in the underlying shell.
Return a command that runs a trace on
command. E.g.,ls -lmight get translated tostrace -f -c -e 'open' -- ls -l.- Parameters:
command (
str) – The command to be traced.
- static subclass(trace_subclass)[source]
Mark a class as being a supported trace collector.
This is a class decorator that adds to a list of supported
Traceclasses for thetrace_collector()factory method.
- subclasses = [<class 'shell_logger.trace.STrace'>, <class 'shell_logger.trace.LTrace'>]
- abstract property trace_args: str
Get the trace command.
The trace command and the arguments you pass to it, but not the command you’re tracing. E.g., return strace -f -c -e “open”.
- Raises:
AbstractMethod – This needs to be overridden by subclasses.
- trace_name = 'undefined'
- shell_logger.trace.trace_collector()[source]
Generate trace collectors.
A factory method that returns any subclass of
Tracethat has the@Trace.subclassdecorator applied to it.