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

  • SEARCH
  • Home
  • 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 8715569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:52:40+00:00 2026-06-13T05:52:40+00:00

I want to have in my application a common logging module that logs to

  • 0

I want to have in my application a common logging module that logs to a file.
For example in my commonlog.py I can have something like this:

# Python logging module
import logging                                                   

logging.basicConfig(filename="test.log", level=logging.DEBUG) 

From the other modules in the application I want to import this module and be able to use it like if it was the Python logging module but without replicating all its functions, for example from module test.py:

import commonlog

commonlog.debug("debug message")
commonlog.info("info message")
commonlog.ANY_OTHER_METHOD_THAT_BELONGS_TO_LOGGING()

How can I “proxy” in my commonlog all the methods from the logging module ?

Doing:

commonlogging.logging.etc..

is not a valid solution because it’s using the logging module directly.

  • 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-13T05:52:41+00:00Added an answer on June 13, 2026 at 5:52 am

    I’ve never had to “inherit” from a module before so I don’t know it’s naive to do a from logging import * at the top of commonlogging. Here’s code showing that it appears to work:

    >>> with open('mylogging.py', 'w') as f:
    ...     f.write('''from logging import *
    ... my_customization = "it works"''')
    ...
    >>> import mylogging
    >>> print mylogging.my_customization
    it works
    >>> help(mylogging.log)
    Help on function log in module logging:
    
    log(level, msg, *args, **kwargs)
        Log 'msg % args' with the integer severity 'level' on the root logger.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this application that I want to support multi languages. I thought the
I have an application with a common Header in all layouts. I want that
I have an installable ASP.Net application that is logging using Common.Logging. When writing log
We have an application that we want to make available to the general internet-using
In my application I want to have one view that holds 2 partial views.
I have a .NET server application that must store passwords that can't be hashed
I have one application that register and verified user's fingerprint.Now I want to know
I have one application that allows user to do various things like rotating and
I want to develop a multi-module application according to OSGi specification. Let's assume that
I have an application that performs fast operations on in-memory data. This data is

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.