Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom datadir for loggers. #402

Open
mojoX911 opened this issue Feb 7, 2025 · 1 comment
Open

Allow custom datadir for loggers. #402

mojoX911 opened this issue Feb 7, 2025 · 1 comment
Labels
enhancement This enhances the code and improves stuffs good first issue issues suitable for early contributors
Milestone

Comments

@mojoX911
Copy link

mojoX911 commented Feb 7, 2025

coinswap/src/utill.rs

Lines 149 to 154 in b309205

pub fn setup_taker_logger(filter: LevelFilter, is_stdout: bool) {
Once::new().call_once(|| {
// TODO: Get the custom datadir instead of the default.
let log_dir = get_taker_dir().join("debug.log");
let file_appender = FileAppender::builder().build(log_dir).unwrap();

Currently all our loggers are always putting the deblug.log file in the default data directory. This means even if the user is passing custom datadir, the log file will be in the default directory.

Make all the setup_logger function to take in a Option<Path> as datadir, and if None then defaults to the default datadir.

@mojoX911 mojoX911 added the enhancement This enhances the code and improves stuffs label Feb 7, 2025
@mojoX911 mojoX911 added this to the v0.1.1 milestone Feb 7, 2025
@mojoX911 mojoX911 added this to core lib Feb 7, 2025
@mojoX911 mojoX911 added the good first issue issues suitable for early contributors label Feb 7, 2025
@0xEgao
Copy link

0xEgao commented Feb 8, 2025

Hey I have made a pr #405 for this ,please review it ,and let me know for any feedbacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This enhances the code and improves stuffs good first issue issues suitable for early contributors
Projects
Status: No status
Development

No branches or pull requests

2 participants