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 9012695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:04:15+00:00 2026-06-16T03:04:15+00:00

I am in a situation where I have a package that is calling logging.debug(xxx).

  • 0

I am in a situation where I have a package that is calling logging.debug(xxx). I want to disable all logging statements by this package. Is there a way to do that via config?

For example, every query I run is printing out in the console of the dev server:

DEBUG:root:SELECT Entities.path, Entities.entity FROM “dev~xxxx!!Entities” AS Entities INNER JOIN “dev~xxxx!!EntitiesByProperty” AS ebp_0 ON Entities.path = ebp_0.path INNER JOIN “dev~xxxx!!EntitiesByProperty” AS ebp_1 ON Entities.path = ebp_1.path INNER JOIN “dev~xxxx!!EntitiesByProperty” AS ebp_2 ON Entities.path = ebp_2.path WHERE ebp_0.kind = :1 AND ebp_0.name = :2 AND ebp_0.value = :3 AND ebp_1.kind = :4 AND ebp_1.name = :5 AND ebp_1.value = :6 AND ebp_2.kind = :7 AND ebp_2.name = :8 AND ebp_2.value = :9 ORDER BY Entities.path ASC

So I know how to disable it by modifying the sdk source, basically comment out the logging statement in __StarSchemaQueryPlan

logging.debug(query)

Is there a way to disable the logging without touching SDK code? We currently do not define any loggingConfigurations, and are using the basicConfiguror.


Final solution thank you @lucemia:

class Filter(object):
    def filter(self, record):
        if record.funcName=='__StarSchemaQueryPlan' and record.module=='datastore_sqlite_stub':
            return 0
        else:
            return 1
  • 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-16T03:04:17+00:00Added an answer on June 16, 2026 at 3:04 am

    You can try to modify the log level.

    Since the module used default logger.
    The following code will disable all log which’s level smaller than critical.

    import logging
    logger = logging.getLogger() # get the default logger
    logger.setLevel(50) # set the skip all log which is smaller than critical (50)
    

    test case

    a_lib.py

    import logging
    
    def main():
        logging.error("test")
        logging.critical('c')
    

    a_test_case.py

    import a_lib
    import logging
    
    logger = logging.getLogger()
    logger.setLevel(50)
    a_lib.main()
    

    results

    > python a_test.py
    CRITICAL:root:c
    

    EDIT 1

    Another way to do so is using filter

    import logging
    
    # define a new filter
    class Filter():
        def filter(self, record):
            # extract property of record such as record.funcName, record.module
            # http://docs.python.org/2/library/logging.html#logrecord-attributes
    
    
            if record.module == "a_lib":
                # if the record is from a module you don't want to log
                return 0
            else:
               # for record you want to log
                return 1
    
    
    
     # apply this filter
    
     filter = Filter()
     logger= logging.getLogger()
     logger.addFilter(filter)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering what is the culturally-acceptable way to handle this code situation. I have
So I'm in the following situation. I have a package generated with py2app. This
I have a quite strange situation. I have this very simple package: Task get
Situation I have a client library that uses the Windows Azure AppFabric Service Bus
I have this situation: http://jsfiddle.net/bRDgK/3/ In this situation I have a modal dialog with
i have situation like this: class IData { virtual void get() = 0; virtual
I have situation, where running a query that filters by an indexed column in
this is an extremely frustrating situation. We have just upgraded to Visual Studio 2010
Situation is pretty straightforward. I have a Java webapp that I'm converting to be
I have the following situation: I have an event handler, that displays small messages

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.