OutpostUniverse / op2ext

Outpost 2 extension module loader
1 stars 0 forks source link

Remove `__FILE__` and `__LINE__` reporting #245

Closed DanRStevens closed 5 years ago

DanRStevens commented 5 years ago

In issue #170, there was some discussion about removing the PostError macro. This would remove the __FILE__ and __LINE__ reporting in the error messages. Instead, code can make direct calls to LogError without this information.

The macro removal would remove the need for one of the FormatLogMessage overloads.

The remaining FormatLogMessage overload has fairly minimal use, and I would suggest the internal uses of Log don't really need to format the "op2ext.dll" module name into their log messages. I would recommend removing such formatting from internal calls. This would increase consistency between internal uses of Log with internal uses of LogDebug and LogError.

The one remaining use of FormatLogMessage would be for the exported Log method that is part of the op2ext API. It's tempting to inline the formatting into that method, though issue #64 might suggest adding additional method exports that would make use of such formatting. In that case, it might make sense to retain the FormatLogMessage method, but perhaps move it out of the now rather generic logging code, and instead put it somewhere more project specific.