Is extending a singleton class wrong?
- by Anwar Shaikh
I am creating a logger for an application. I am using a third party logger library. In which logger is implemented as singleton.
I extended that logger class because I want to add some more static functions. In these static functions I internally use the instance (which is single) of Logger(which i inherited).
I neither creates instance of MyLogger nor re-implemented the getInstance() method of super class.
But I am still getting warnings like destructor of MyLogger can not be created as parent class (Loggger) destructor is not accessible.
I want to know,
I am I doing something wrong?
Inheriting the singleton is wrong or should be avoided??