You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each time an instance of the classes are constructed a new static instance is created behind the scenes;
So when PLOG## is called it will log out several times, because there are several instance of the logger
e.g. in the following CDoMgic2 has been created twice, but the 2nd instance is logging out 3 times.
2023-08-17 14:28:48.507 INFO [21584] [CDoMagic::CDoMagic@9] CDoMagic Created
2023-08-17 14:28:48.509 INFO [21584] [CDoMgic2::CDoMgic2@9] CDoMgic2 Created
2023-08-17 14:28:48.509 INFO [21584] [CDoMgic2::CDoMgic2@9] CDoMgic2 Created
2023-08-17 14:28:48.511 INFO [21584] [CDoMgic2::~CDoMgic2@14] CDoMgic2 Destroyed
2023-08-17 14:28:48.511 INFO [21584] [CDoMgic2::~CDoMgic2@14] CDoMgic2 Destroyed
2023-08-17 14:28:48.513 INFO [21584] [CDoMagic::~CDoMagic@14] CDoMagic Destroyed
2023-08-17 14:28:48.513 INFO [21584] [CDoMagic::~CDoMagic@14] CDoMagic Destroyed
2023-08-17 14:28:48.518 INFO [21584] [CDoMgic2::CDoMgic2@9] CDoMgic2 Created
2023-08-17 14:28:48.518 INFO [21584] [CDoMgic2::CDoMgic2@9] CDoMgic2 Created
2023-08-17 14:28:48.518 INFO [21584] [CDoMgic2::CDoMgic2@9] CDoMgic2 Created
scenario
I want use DI / IoC style creation in Several Exported Classes from several DLL's
For DLL that has several classes I am using chaining:
Each time an instance of the classes are constructed a new static instance is created behind the scenes;
So when PLOG## is called it will log out several times, because there are several instance of the logger
e.g. in the following CDoMgic2 has been created twice, but the 2nd instance is logging out 3 times.
code to demonstrate above:
The text was updated successfully, but these errors were encountered: