Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
colon in communique log file stops start-up on windows platform. need
to have colon removed. easiest way to do that is just to replace them
with hyphens... shrug.
  • Loading branch information
ifly6 committed Jan 19, 2020
1 parent a72b03c commit a99b3bc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/com/git/ifly6/communique/ngui/Communique.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,15 @@ else if (CommuniqueUtils.IS_OS_MAC) {

// Make sure we can also log to file, apply this to the root logger
try {
// must avoid colons in file names because windows doesn't like it apparently
String timeString = DateTimeFormatter.ISO_LOCAL_DATE_TIME.withZone(ZoneId.systemDefault())
.format(Instant.now())
.replace(':', '-'); // this is the cheapest way to fix this problem

Path logFile = appSupport
.resolve("log")
.resolve(String.format("communique-session-%s.log",
DateTimeFormatter.ISO_LOCAL_DATE_TIME.withZone(ZoneId.systemDefault())
.format(Instant.now())));
.resolve(String.format("communique-session-%s.log", timeString));

Files.createDirectories(logFile.getParent()); // make directory
loggerFileHandler = new FileHandler(logFile.toString());
loggerFileHandler.setFormatter(new SimpleFormatter());
Expand Down

0 comments on commit a99b3bc

Please sign in to comment.