Skip to content

Commit

Permalink
add log to config loading
Browse files Browse the repository at this point in the history
bump version
  • Loading branch information
takotori committed Jun 1, 2024
1 parent f9ba78e commit 555e66d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 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 = "re_set-lib"
version = "5.0.2"
version = "5.0.3"
edition = "2021"
description = "Data structure library for ReSet"
repository = "https://github.com/Xetibo/ReSet-Lib"
Expand Down
4 changes: 3 additions & 1 deletion src/utils/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{fs, io::Read};
use once_cell::sync::Lazy;
use toml::Table;

use crate::ERROR;
use crate::{ERROR, LOG};
#[cfg(debug_assertions)]
use crate::{utils::macros::ErrorLevel, write_log_to_file};

Expand All @@ -27,6 +27,7 @@ pub const CONFIG: Lazy<Table> = Lazy::new(parse_config);
pub fn parse_config() -> Table {
unsafe {
let config_file = fs::File::open(CONFIG_STRING.as_str());
LOG!(format!("Config file: {}", CONFIG_STRING.as_str()));
if config_file.is_err() {
ERROR!("Could not write config file", ErrorLevel::Recoverable);
return Table::new();
Expand All @@ -40,6 +41,7 @@ pub fn parse_config() -> Table {
ERROR!("Could not read config file", ErrorLevel::Recoverable);
return Table::new();
}
LOG!(format!("Config file content: {}", config_string));
config_string.parse::<Table>().expect("Config has errors")
}
}
Expand Down

0 comments on commit 555e66d

Please sign in to comment.