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

TimestampsCustomFormat with empty current_infix #161

Closed
jb-alvarado opened this issue Jun 10, 2024 · 1 comment
Closed

TimestampsCustomFormat with empty current_infix #161

jb-alvarado opened this issue Jun 10, 2024 · 1 comment

Comments

@jb-alvarado
Copy link
Contributor

Sorry @emabee that I disturbing you again. Thank you that you have merge and optimize my pull request.

The only sad thing is now, that: when you want a empty current_infix the logic adds a _ to the basename. For example:

let writer = FileLogWriter::builder(
    FileSpec::default()
        .suppress_timestamp()
        .basename("ffplayout")
)
.append()
.rotate(
    Criterion::Age(Age::Day),
    Naming::TimestampsCustomFormat {
        current_infix: Some(""),
        format: "%Y-%m-%d",
    },
    Cleanup::KeepLogFiles(7),
)

Gives a file: ./ffplayout_.log. My goal was to just get : ./ffplayout.log, that is the normal behavior most programs in linux logs to /var/log/.

@emabee
Copy link
Owner

emabee commented Jun 10, 2024

Good point, I wasn't aware of this case. I added the support for this to 0.28.3

@emabee emabee closed this as completed Jun 10, 2024
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

No branches or pull requests

2 participants