Optionally write source location for logs#1742
Conversation
|
#1741 was merged so this needs a rebase |
|
Rebased. |
|
The main point of |
That adds templates which means worse errors and increased build times. I'd rather just change it to use |
It does add one more template, but I think it should be doing better overall on compile time/binary size, since it moves
Not a bad idea and it would make more sense than the current version. Macro-based logging APIs have certain advantages e.g. not evaluating arguments when the log level is disabled. In that case we should really redesign the API to avoid using common words like |
How would you propose doing that? I mean, we use that everywhere in unv/daemon, it would be a huge compatibility break if we just rename it. Maybe new names as an altenative and deprecate the current ones, then remove them at some later point? |
Yeah that is what they are proposing. I wonder who will bother to test this. |
Yeah that would be annoying; personally I would keep the version without macros. If we did change it maybe we could have both APIs exist for a period and you just wouldn't get the line number if you use the old one. |
|
Changed it to use |
661d2c4 to
b48243c
Compare
Adds `logs.writeSrcLocation.*` cvars. If `<source_location>` is supported, this will add the source of the log to the log line itself.
b48243c to
a328a22
Compare
illwieckz
left a comment
There was a problem hiding this comment.
LGTM. If someone has a better idea for a part of this he can submit a patch after this is merged.
|
So, I only catch it now, because I did not do a LTO build before… When I build with LTO enabled I get those errors when building the native DLL/EXE game (not the engine!): @VReaperV Any idea on how to prevent that? |
|
I also get that error when building the nexe game. |
|
As I said above:
We could switch to the version from the |
|
Whose bright fucking idea was it to randomly declare a function called |
|
Unvanquished/Unvanquished#3429 should fix it. |
Based on #1741 because it adds the cmake option for building with a higher C++ standard.
Adds optional logging of source location with logs, controlled by
logs.writeSrcLocation.*cvars, to help with debugging.