mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-22 03:02:49 +00:00
Add PID to logfile
This avoid log corruption when multiple gBar instances are open at the same, as the logfile was the same
This commit is contained in:
parent
9ecba84be5
commit
6f9da7f7c9
1 changed files with 3 additions and 2 deletions
|
@ -9,10 +9,11 @@ namespace Logging
|
||||||
|
|
||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
logFile = std::ofstream("/tmp/gBar.log");
|
pid_t pid = getpid();
|
||||||
|
logFile = std::ofstream("/tmp/gBar-" + std::to_string(pid) + ".log");
|
||||||
if (!logFile.is_open())
|
if (!logFile.is_open())
|
||||||
{
|
{
|
||||||
LOG("Cannot open logfile(/tmp/gBar.log)");
|
LOG("Cannot open logfile(/tmp/gBar-" << pid << ".log)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue