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

14 implement logger initialization logic #15

Merged
merged 21 commits into from
Dec 22, 2023

Conversation

archeoss
Copy link
Contributor

Resolves #14

Merging #9 will make this PR easier to review

@archeoss archeoss requested a review from ikopylov September 23, 2023 10:26
@archeoss archeoss linked an issue Sep 23, 2023 that may be closed by this pull request
cli/src/config.rs Outdated Show resolved Hide resolved
@archeoss archeoss changed the base branch from main to 1-init-project-backend October 3, 2023 13:41
@archeoss archeoss force-pushed the 14-implement-logger-initialization-logic branch from 3da5b70 to 246ea40 Compare October 3, 2023 13:41
@archeoss
Copy link
Contributor Author

archeoss commented Oct 3, 2023

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @archeoss and the rest of your teammates on Graphite Graphite

@archeoss archeoss requested a review from ikopylov October 3, 2023 13:45
@archeoss archeoss force-pushed the 14-implement-logger-initialization-logic branch from 835b80c to e1a600a Compare October 3, 2023 22:08
@archeoss archeoss changed the base branch from 1-init-project-backend to main October 6, 2023 12:55
@archeoss archeoss force-pushed the 14-implement-logger-initialization-logic branch from e1a600a to adf1f86 Compare October 6, 2023 12:56
@archeoss archeoss force-pushed the 14-implement-logger-initialization-logic branch from adf1f86 to 3411daa Compare November 13, 2023 14:23
backend/src/config.rs Outdated Show resolved Hide resolved
backend/src/config.rs Outdated Show resolved Hide resolved
cli/src/config.rs Outdated Show resolved Hide resolved
@ikopylov
Copy link
Member

Please, fix merge conflicts

@archeoss archeoss force-pushed the 14-implement-logger-initialization-logic branch from 6271683 to 64263a2 Compare November 27, 2023 16:51
@archeoss archeoss requested a review from ikopylov November 27, 2023 17:38
backend/src/config.rs Outdated Show resolved Hide resolved
backend/src/config.rs Outdated Show resolved Hide resolved
@archeoss archeoss requested a review from ikopylov December 17, 2023 05:50
backend/src/config.rs Outdated Show resolved Hide resolved
@archeoss archeoss requested a review from ikopylov December 22, 2023 06:28
fn init_file_rotate(&self) -> Result<FileRotate<AppendTimestamp>, LoggerError> {
let config = self.file.as_ref().ok_or(LoggerError::EmptyConfig)?;
let log_file = config.log_file.as_ref().ok_or(LoggerError::NoFileName)?;
log_file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary complication of code readability. The code would be much clearer in this form:

if log_file.as_os_str().is_empty() {
    return Err(LoggerError::NoFileName);
}

backend/src/config.rs Outdated Show resolved Hide resolved
backend/src/config.rs Outdated Show resolved Hide resolved
Copy link
Member

@ikopylov ikopylov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ikopylov ikopylov merged commit d46cd94 into main Dec 22, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement logger initialization logic
2 participants