Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7709881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:58:25+00:00 2026-06-01T00:58:25+00:00

I am creating a logger for an application. I am using a third party

  • 0

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??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:58:26+00:00Added an answer on June 1, 2026 at 12:58 am

    Leaving the merits of singleton pattern aside (there is a school of thought that describes it as an anti-pattern) it should not be necessary to subclass it to simply add static functionality. Here are language-specific approaches that I would prefer to subclassing a singleton:

    • Use a free-standing function enclosed in a C++ namespace
    • Use an extension class in C#
    • Use a helper class in Java
    • Use a Category in Objective-C
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application has a homebrew logging class that I'm migrating to using log4j under
I am creating a Prism 2.1 app in which I have implemented logging, using
Creating this application has become a pain in the ass! Using Java I want
I'm creating a logger application thing to learn WPF, and I want new messages
I am creating a web application using Form Authentication of Asp.Net with C# and
In my application, I use log4net, with all types creating their own logger based
I'm creating a WPF application, for which all users must be authenticated to an
I'm currently in the process of creating a Windows service application which will monitor
First, the background: I am creating a Flex application with a component that displays
We have an application that logs to files currently using streamwriter. As we are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.