Skip to content

Commit

Permalink
Merge pull request #188 from Achiefs/187-add-logs-date
Browse files Browse the repository at this point in the history
Add date to log line
  • Loading branch information
okynos authored Jan 23, 2025
2 parents 9244a9f + a190378 commit 4d650c5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fim"
version = "0.5.2"
version = "0.5.3"
authors = ["José Fernández <´pylott@gmail.com´>"]
edition = "2021"

Expand Down
6 changes: 6 additions & 0 deletions pkg/deb/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
fim (0.5.3-1) xenial; urgency=medium

* More info: https://github.com/Achiefs/fim/releases/tag/v0.5.3

-- Jose Fernandez <support@achiefs.com> Mon, 20 Jan 2025 19:14:00 +0000

fim (0.5.2-1) xenial; urgency=medium

* More info: https://github.com/Achiefs/fim/releases/tag/v0.5.2
Expand Down
3 changes: 3 additions & 0 deletions pkg/rpm/fim.spec
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ rm -fr %{buildroot}
# -----------------------------------------------------------------------------

%changelog
* Mon Jan 20 2025 support <support@achiefs.com> - 0.5.3
- More info: https://github.com/Achiefs/fim/releases/tag/v0.5.3

* Wed Jan 15 2025 support <support@achiefs.com> - 0.5.2
- More info: https://github.com/Achiefs/fim/releases/tag/v0.5.2

Expand Down
2 changes: 1 addition & 1 deletion src/appconfig.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (C) 2021, Achiefs.

// Global constants definitions
pub const VERSION: &str = "0.5.2";
pub const VERSION: &str = "0.5.3";
pub const NETWORK_MODE: &str = "NETWORK";
pub const FILE_MODE: &str = "FILE";
pub const BOTH_MODE: &str = "BOTH";
Expand Down
11 changes: 8 additions & 3 deletions src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use crate::utils;

pub fn init() -> (AppConfig, Ruleset) {
use std::path::Path;
use simplelog::WriteLogger;
use simplelog::Config;
use simplelog::{ WriteLogger, ConfigBuilder, format_description };
use std::fs;

println!("[INFO] Achiefs File Integrity Monitoring software starting!");
Expand All @@ -21,10 +20,16 @@ pub fn init() -> (AppConfig, Ruleset) {
).parent().unwrap().to_str().unwrap()
).unwrap();

// Modify the logger configuration
let log_config = ConfigBuilder::new()
.set_time_format_custom(format_description!(
"[year]-[month]-[day]T[hour]:[minute]:[second].[subsecond digits:4]"))
.build();

// Create logger output to write generated logs.
WriteLogger::init(
cfg.clone().get_level_filter(),
Config::default(),
log_config,
fs::OpenOptions::new()
.create(true)
.append(true)
Expand Down

0 comments on commit 4d650c5

Please sign in to comment.