pub struct ActivityLogService { /* private fields */ }Expand description
Service for logging vault activities to JSONL file.
Implementations§
Source§impl ActivityLogService
impl ActivityLogService
Sourcepub fn new(vault_root: &Path, config: ActivityConfig) -> Self
pub fn new(vault_root: &Path, config: ActivityConfig) -> Self
Create a new ActivityLogService for the given vault.
Sourcepub fn try_from_config(config: &ResolvedConfig) -> Option<Self>
pub fn try_from_config(config: &ResolvedConfig) -> Option<Self>
Create from ResolvedConfig. Returns None if activity logging is disabled.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if logging is enabled.
Sourcepub fn should_log(&self, op: Operation) -> bool
pub fn should_log(&self, op: Operation) -> bool
Check if a specific operation should be logged.
Sourcepub fn log(&self, entry: ActivityEntry) -> Result<(), ActivityError>
pub fn log(&self, entry: ActivityEntry) -> Result<(), ActivityError>
Log an activity entry.
Sourcepub fn log_new(
&self,
note_type: &str,
id: &str,
path: &Path,
title: Option<&str>,
) -> Result<(), ActivityError>
pub fn log_new( &self, note_type: &str, id: &str, path: &Path, title: Option<&str>, ) -> Result<(), ActivityError>
Log a “new” operation (note creation).
Sourcepub fn log_complete(
&self,
note_type: &str,
id: &str,
path: &Path,
summary: Option<&str>,
) -> Result<(), ActivityError>
pub fn log_complete( &self, note_type: &str, id: &str, path: &Path, summary: Option<&str>, ) -> Result<(), ActivityError>
Log a “complete” operation (task completed).
Sourcepub fn log_cancel(
&self,
note_type: &str,
id: &str,
path: &Path,
reason: Option<&str>,
) -> Result<(), ActivityError>
pub fn log_cancel( &self, note_type: &str, id: &str, path: &Path, reason: Option<&str>, ) -> Result<(), ActivityError>
Log a “cancel” operation (task cancelled).
Sourcepub fn log_capture(
&self,
capture_name: &str,
target_path: &Path,
section: Option<&str>,
) -> Result<(), ActivityError>
pub fn log_capture( &self, capture_name: &str, target_path: &Path, section: Option<&str>, ) -> Result<(), ActivityError>
Log a “capture” operation.
Sourcepub fn log_rename(
&self,
note_type: &str,
old_path: &Path,
new_path: &Path,
references_updated: usize,
) -> Result<(), ActivityError>
pub fn log_rename( &self, note_type: &str, old_path: &Path, new_path: &Path, references_updated: usize, ) -> Result<(), ActivityError>
Log a “rename” operation.
Sourcepub fn log_focus(
&self,
project: &str,
note: Option<&str>,
action: &str,
) -> Result<(), ActivityError>
pub fn log_focus( &self, project: &str, note: Option<&str>, action: &str, ) -> Result<(), ActivityError>
Log a “focus” operation.
Sourcepub fn rotate_if_needed(&self) -> Result<(), ActivityError>
pub fn rotate_if_needed(&self) -> Result<(), ActivityError>
Perform log rotation if needed. Should be called at startup or periodically.
Sourcepub fn read_entries(
&self,
since: Option<DateTime<Utc>>,
until: Option<DateTime<Utc>>,
) -> Result<Vec<ActivityEntry>, ActivityError>
pub fn read_entries( &self, since: Option<DateTime<Utc>>, until: Option<DateTime<Utc>>, ) -> Result<Vec<ActivityEntry>, ActivityError>
Read entries within a date range (for querying).
Auto Trait Implementations§
impl Freeze for ActivityLogService
impl RefUnwindSafe for ActivityLogService
impl Send for ActivityLogService
impl Sync for ActivityLogService
impl Unpin for ActivityLogService
impl UnsafeUnpin for ActivityLogService
impl UnwindSafe for ActivityLogService
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