The constructor does initialize `g_Logger` and the destructor resets it.
Previously `g_Logger` was reset to `nullptr`. Now it's reset to the previous `CLogger` (the `nullLogger`).
Now the `CLogger` is stored on the stack instead of dynamic memory.
I strive to introduse such "guards" for more globals.
Which is the best name:
- `LifetimeGuard` It manages the lifetime of an external object.
- `InitGuard` Other such classes might not be about lifetime.
- `ScopedLifetime` Because it does something on scope exit.
- `ScopedGuard` one might think it's a combination of `std::scoped_lock` and `std::lock_guard`.
Should it be `CLogger::LifetimeGuard` or `LifetimeGuard<CLogger>`?