Skip to content

[WIP] FIX #1603; Add customizable log directory

Christopher Schinnerl requested to merge Eriner:log-dir into master

Created by: Eriner

I've authored a small patch here, but would like to get your input before moving forward, as I'm not all that familiar with the project. FWIW, the patch works as expected, minus argument/input path validation/creation, which is something I'd like your input on.

My understanding, after looking at some of the code for a few minutes, was the best place to place persist "setter" was in the daemon.go file. I had originally attempted to place it at the beginning of the startDaemon function, after it calls processConfig, but this caused a race due to the go profile.StartContinuousProfile() routine calling NewFileLogger() before the LogDir var was set. Thus, I had to place it before that call, in the startDaemonCmd function. If this is an issue or there's a better way to go about this, please let me know.

As I mention in the WIP patch TODO, I know path/directory validation and creation is currently missing (it will fail on a non-existent directory) and the native string concat for the filepath is naïve -- this is just a proof-of-concept and to get feedback to see if I'm on the right track here.

Merge request reports