plog icon indicating copy to clipboard operation
plog copied to clipboard

Fix backward compatibiltiy

Open bitFiedler opened this issue 2 years ago • 5 comments

Because of the Constructor interface changes, backward compatibility should be kept. By initialize the instanceId with the fallback value, there should be no problems by updating to newer versions. Because since git #8d9767390eb0c2f7f05c68cfcbba698042f8d0a0 Add logger instanceId into Record (#141) the interface had changed and with older implementations it was not possible to adapt without changed.

Here is the changed line in Record.h

Record(Severity severity, const char* func, size_t line, const char* file, const void* object, int instanceId = 0)

bitFiedler avatar Nov 04 '22 19:11 bitFiedler

How did you find it?

SergiusTheBest avatar Nov 08 '22 22:11 SergiusTheBest

Record.zip that is done in the Record.h file line 229 with the constructor call. the last argument instanceId is set with an default value to 0.

bitFiedler avatar Nov 10 '22 16:11 bitFiedler

because old version do not know of the instanceId and therefore the new argument break the compile, therefore I found the new extension and add it the default. that fixed the build and all was good.

bitFiedler avatar Nov 10 '22 16:11 bitFiedler

I mean how do you mix old and new versions? What is using the old version and what is using the new version and how those parts are connected to each other?

SergiusTheBest avatar Nov 10 '22 16:11 SergiusTheBest

I only updated plog to the latest version and add it as lib. The linking didn’t worked because of the changed interface. Therefore I fixed the Interface.

bitFiedler avatar Nov 10 '22 18:11 bitFiedler