Strange class problem

PaulS is right. You really need to read up on "static initialization order fiasco".

The order in which static data is instantiated is undefined, particularly between compilation units. In your case, if you are using Serial, then Serial.begin() is done in setup, but if your dbg class uses Serial it will definitely be calling it too soon (the constructor will be called before setup).

The same remark applies to timers, and indeed anything related to Arduino libraries.