Closed rainman110 closed 10 months ago
In GitLab by @mariusalexander on May 3, 2023, 13:47
created branch 43-enabling-log-file-and-line-numbers-flag-will-break-verbosity-levels
to address this issue
In GitLab by @rainman110 on May 5, 2023, 10:08
mentioned in commit 40b1f321d093f22b14c72376ff3219ffa8ca15ee
In GitLab by @mariusalexander on May 3, 2023, 12:31
Enabling the
GT_LOG_IMPL_LINE_NUMBERS
flag and using verbosity levels will still log the file and line numbers.Example:
Explanation
A macro like
gtDebug
will be expanded toIf the
GT_LOG_LINE_NUMBERS
flag is enabled the macroGT_LOG_IMPL_LINE_NUMBERS
will be replaced by.operator<<( __FILE__ "@" GT_LOG_TO_STR(__LINE__) ":")
The logging statement
will therefore effectively be translated to
One can now see that the file and line numbers will be printed but not the rest of the message.
Obviously the file and line numbers should not be logged when using a higher verbosity level. This would either require changes to the logging macro or an additional check in the
gt::log::Logger::Helper
destructor for the verbosity level.