Struct exar::Logger [] [src]

pub struct Logger {
    // some fields omitted
}

Exar DB's event logger.

Examples

extern crate exar;

use exar::*;

let log = Log::new("/path/to/logs", "test", 100);
let event = Event::new("data", vec!["tag1", "tag2"]);

let mut logger = Logger::new(log).unwrap();
let event_id = logger.log(event).unwrap();

Methods

impl Logger
[src]

fn new(log: Log) -> Result<LoggerDatabaseError>

Creates a new logger for the given Log or returns a DatabaseError if a failure occurs.

fn log(&mut self, event: Event) -> Result<u64DatabaseError>

Appends the given event to the log and returns the event id or a DatabaseError if a failure occurs.

fn bytes_written(&self) -> u64

Returns the total number of bytes logged.

Trait Implementations

impl Debug for Logger
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.