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

":" in program_name and strftime of log stream name cause errors #208

Open
SilentEroder opened this issue Sep 8, 2024 · 0 comments
Open

Comments

@SilentEroder
Copy link

SilentEroder commented Sep 8, 2024

Problem 1 program_name

Windows contains ":" in program_name of log stream name.
For example, C:\

log stream name should not have ":" and "*". In regex, [^:*]
So, sys.argv[0] causes an error in Windows.

Solution 1 program_name

Remove all ":" in sys.argv[0]

program_name=sys.argv[0],  # before
program_name=sys.argv[0].replace(":", ""),  # after

#207

Problem 2 strftime

strftime of log stream name contains ":" because datetime.datetime.now() contains ":"
For example, 11:22:35

log stream name should not have ":" and "*". In regex, [^:*]
So, datetime.datetime.now() causes an error in Windows.

Solution 2-1 strftime

Remove all ":" in datetime.datetime.now()

from datetime import datetime, timezone

strftime=datetime.now(timezone.utc),  # before
strftime=str(datetime.now(timezone.utc)).replace(":", "-"),  # after

However, you can't use {strftime:%Y-%m-%d %H-%M-%S} with editing.

Solution 2-2 strftime

You can use {strftime:%Y-%m-%d %H-%M-%S} without editing.

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

1 participant