(Systemd) logging crates
Some checks failed
Run Tests on Code / run-tests (push) Failing after 25s

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

@ -12,3 +12,6 @@ serde = "1.0.152"
serde_derive = "1.0.152"
serde_json = "1.0.93"
strum_macros = "0.24.3"
log = "^0.4.20"
systemd-journal-logger = "^2.1.1"
confy = "0.5.1"

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;