pub struct SessionLogger { /* private fields */ }Expand description
Logger that tees events to an NDJSON file.
Implementations§
Source§impl SessionLogger
impl SessionLogger
Sourcepub fn new(session_id: &str, config: &TaskConfig) -> Result<Self>
pub fn new(session_id: &str, config: &TaskConfig) -> Result<Self>
Create a new session logger.
Creates ~/.local/share/harness/sessions/<id>.ndjson and writes events there.
Sourcepub fn new_with_name(
session_id: &str,
config: &TaskConfig,
name: Option<String>,
) -> Result<Self>
pub fn new_with_name( session_id: &str, config: &TaskConfig, name: Option<String>, ) -> Result<Self>
Create a new session logger with an optional human-readable name.
Writes events to a .ndjson.tmp file, which is atomically renamed
to .ndjson on [finalize]. If the process crashes, the .tmp file
remains for debugging.
Source§impl SessionLogger
impl SessionLogger
Sourcepub fn sessions_dir() -> Result<PathBuf>
pub fn sessions_dir() -> Result<PathBuf>
Default sessions directory: ~/.local/share/harness/sessions/.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionLogger
impl RefUnwindSafe for SessionLogger
impl Send for SessionLogger
impl Sync for SessionLogger
impl Unpin for SessionLogger
impl UnwindSafe for SessionLogger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more