question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update log filenames to be less confusing across platforms

See original GitHub issue

What I’m seeing on OSX is that the plot filenames in the file browser (Finder.app) look like

2021-04-21-09/08/55.log

this is quite odd given the filesystem uses forward slashes as directories. When I check the dir in terminal via ls etc it looks like this:

2021-04-20-23\:13\:57.log

So I think perhaps because of my filesystem (APFS in this case) or the OS I’m seeing two totally different things which makes understanding and debugging and support more challenging.

Checking the source, i see it is using colons, so i know that is what plotman is saving.

The backslashes in CLI make sense (it does the same thing for spaces), however the display in Finder is really weird to me.

Thoughts on avoiding colons to make things more compatible? I think YYYYMMDD-HHMMSS would still sort nicely and be readable if needed. BTW should log names be more precise than seconds to avoid collisions ever?

Screen Shot 2021-04-21 at 9 29 24 AM

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
altendkycommented, Apr 22, 2021

I think Windows bans colons outright. It would be nice to use a standardized format, but I’m not sure one exists that is file name compatible. https://github.com/ericaltendorf/plotman/issues/108#issuecomment-817763506 ISO8601 with : -> - might be as close as we get. I’d personally keep the seconds. I’d rather have 60x the resolution I need than 0.9x. Maybe even the time zone. And yes, I did actually have two plotters set with different time zones… Regardless, I suppose the code should have a fall back in case of collision.

0reactions
BasilHorowtcommented, Apr 27, 2021

@altendky and I talked about this for a bit and ended up with the plan to:

  1. Replace : with _ to ensure cross platform compatibility
  2. Increase precision by adding microseconds to the end of the timestamp .123412. This will ensure that collisions do not occur even at scale (someone could be plotting on many machines and consolidating logs for analysis?)
  3. Appending the timezone to the end of the timestamp with +hh:mm or -hh:mm so that the log names have comprehensive time information present. We looked into it and + shouldn’t be a problem in the filename
Read more comments on GitHub >

github_iconTop Results From Across the Web

What characters are safe in cross-platform file names for Linux ...
Something to really keep in mind here, linux system are able to consider uppercase and lower as distinct, whilst Windows considers them the...
Read more >
Best Practices for File Naming - Records Express
Adopting good file naming conventions can help ensure that files will work with different operating systems and disk formats, such as Windows, ...
Read more >
What are conventions for filenames in Go? - Stack Overflow
@Fire: filenames are generally all lowercase in case, both for consistency and for systems with case-insensitive filesystems. For anyone with the same question ......
Read more >
You receive error messages when opening an Office document
If the filename or path is long, try renaming the file or copying it to a different folder. Screenshot of the error message....
Read more >
Find Files Faster: How to Organize Files and Folders - Zapier
Browsing through your folders and finding files should be intuitive. ... If you want to maintain your folder structure long-term, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found