alembic-log 0.1.3

A Rust crate that lets you log once, send anywhere.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::time::{SystemTime, UNIX_EPOCH};

use chrono::Local;

pub fn generate_unix_timestamp() -> u64 {
    let epoch: SystemTime = SystemTime::now();
    let timestamp: u64 = epoch
        .duration_since(UNIX_EPOCH)
        .expect("We are time traveling?")
        .as_secs();
    timestamp
}

pub fn generate_human_timestamp() -> chrono::DateTime<Local> {
    Local::now()
}