Skip to content

Commit d4d548f

Browse files
authored
[OLOG-57] do not log to file if path is empty (#84)
* [OLOG-57] do not log to file if path is empty * release notes
1 parent 7c85ed1 commit d4d548f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

doc/releaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,6 @@ This file describes the main feature changes for each InfoLogger released versio
126126

127127
## v2.5.0 - 17/06/2022
128128
- added InfoLogger::filterDiscardSetFile(), to allow saving to local file the messages that would be discarded with filterDiscard(...) settings.
129+
130+
## v2.5.1 - 13/07/2022
131+
- do not try to log to file if the path is empty.

src/InfoLogger.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,9 +1191,8 @@ void InfoLogger::filterDiscardLevel(int excludeLevel) {
11911191
int InfoLogger::filterDiscardSetFile(const char *path, unsigned long rotateMaxBytes, unsigned int rotateMaxFiles, unsigned int rotateNow) {
11921192
mPimpl->filterDiscardFileEnabled = false;
11931193
int err = mPimpl->filterDiscardFile.setLogFile(path, rotateMaxBytes, rotateMaxFiles, rotateNow);
1194-
if (!err) {
1194+
if (!err && path != nullptr && path[0] != '\0') {
11951195
mPimpl->filterDiscardFileEnabled = true;
1196-
//mPimpl->filterDiscardFile.setOutputFormat(SimpleLog::FormatOption::ShowMessage);
11971196
}
11981197
return err;
11991198
}

0 commit comments

Comments
 (0)