(Systemd) logging crates

This commit is contained in:
Neshura 2023-12-25 16:24:40 +01:00
parent 7efa41a48c
commit ae80119fa8
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
2 changed files with 7 additions and 0 deletions

View file

@ -3,6 +3,8 @@ use reqwest::blocking::get;
use serde_derive::{Deserialize, Serialize};
use std::{fs, thread::{sleep}};
use chrono::{Utc, Duration};
use log::{info, warn, error, LevelFilter};
use systemd_journal_logger::JournalLog;
mod config;
mod cloudflare;
@ -356,6 +358,8 @@ fn update_dns() {
}
fn main() {
JournalLog::new().expect("Systemd-Logger crate error").install().expect("Systemd-Logger crate error");
log::set_max_level(LevelFilter::Info);
let mut now = Utc::now() - Duration::seconds(59);
let mut current = now;