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

Ability to create only date log file name #153

Merged
merged 2 commits into from
Jan 20, 2024
Merged

Ability to create only date log file name #153

merged 2 commits into from
Jan 20, 2024

Conversation

krystejj
Copy link

Previously, it was not possible to create FileSpec for creating log file only with date in its name because if basename was set to an empty string then there was an underscore before date (_2024-01-14_00-43-30.log). Now if basename is an empty string then there is no underscore at the beginning (2024-01-14_00-43-30.log). Also added suppress_basename() function to FileSpec that just sets basename to an empty string.

Now, this:

FileSpec::default()
  .directory("logs")
  .suppress_basename();

will give you file path: logs/2024-01-14_00-43-30.log.

Previously only this was possible:

FileSpec::default()
  .directory("logs")
  .basename("");

but it was giving: logs/_2024-01-14_00-43-30.log.

@emabee emabee merged commit c444cae into emabee:master Jan 20, 2024
0 of 10 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.

2 participants