I would like to store logs between runs of the app. Pretty simple and standard directory structure:
- bin
- app.exe
- logs
- 2020
- September
- 2020-09-05T12-00-13_LogIdent.log
- October
- 2021
And Urho3D has a convenient logging system, I just need to set the log name with directory at runtime.
void MyApp::Setup()
{
engineParameters_[EP_LOG_NAME] = log_name;
}
My question is, what’s the best (or standard) way to implement this behavior? What do you guys do for your projects? In other words, what basic procedure do you use to define log_name
? The problem is the user could open the executable from any directory, or move the built bundle around, etc., so the path can’t be fixed at compile-time.