I'm working on an application, and adding logging, but now I'm stuck.

I want to allow (not force!) the user to set the location of the logfile.

Basically, my problem is:

  • logger initialization should be the first thing the program does
  • but I can't initialize the logger until I determine where the user wants the log to be saved
  • determining where the log should be saved ... is a process that should be logged

How is this problem solved? Are log file locations not user-customizable? Is log output buffered until a logfile is set?

没有正确的解决方案

许可以下: CC-BY-SA归因
scroll top