tiny: Logger fails to create log file when channel name includes forward slash

@Kabouik reports in #211

I think the issue might be related to Gitter rooms being formatted with a slash in their name, which must conflict with the way tiny sets filenames for logs. You can see above in my configuration file that the channel I wanted to join on irc.gitter.im was “#jarun/nnn”. If this is really the cause, then perhaps an acceptable workaround would be to replace / with another character when creating new log files, such as -?

In other words when the channel name contains / logger fails to create the log file and reports this in “mentions” tab:

Logger error: Os { code: 2, kind: NotFound, message: "No such file or directory" }

Two TODOs:

  • The error message should show the file path
  • We should handle channel names with /s in them (as far as I can see RFC 2812 allows this)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (11 by maintainers)

Commits related to this issue

Most upvoted comments

OK, done.

@Kabouik thanks… so the problem is logger can’t create the log directory. I slightly improved the error message in b7dfd9c so you’ll now see the path it failed to create. I think the most common reason for this is you have /foo/bar/baz as your log directory but /foo/bar doesn’t exist. We currently don’t create parent directory, we assume that it exists. Perhaps we should change this to create all directories. Any opinions on that? cc @trevarj

@Kabouik thanks again for reporting this. Please let me know if you encounter any other problems.