python logging.getLogger().getEffectivelevel()














































python logging.getLogger().getEffectivelevel()



               logging.getLogger().getEffectiveLevel()

Description: 
       logger method getEffectiveLevel returns the effective level of logger object.
         -  on the current logger object it's evaluated as an effective level.
         _  if the level is not explicitly set on a logger object it inherits from the parent's effective level.
         -  if a parent does not have a level set, it's the parent in the hierarchy is examined until the level which is set to the logger is found. By default root logger has a level set to WARNING.

Program:

the default level of the root logger is a warning and the non-root logger default level is NOTSET.

# import logging module
import logging

# get logger object which is root if not define name
rootlogger = logging.getLogger()

# get non-root logger object by define name = __name__
nonroot    = logging.getLogger(__name__)

# default level of root logger
print('Root logger level : ', rootlogger.level)
# effective level of root logger
print('Root logger Effective logger : ', rootlogger.getEffectiveLevel())
# default level of nonroot logger
print('Non-Root logger level : ', nonroot.level)
# effective level of non-root logger
print('Non-Root logger Effective level : ',nonroot.getEffectiveLevel())


Output:
Root logger level :  30
Root logger Effective logger :  30
Non-Root logger level :  0
Non-Root logger Effective level :  30

     

More Articles of AARTI SHELAR:

Name Views Likes
Python Beautiful Soup : Scrape the Rate of Movie from IMDb 98 0
Python BeautifulSoup : Scrape the Review of mask from Amazon 180 0
Python Beautiful Soup : Scrape the Redmi mobile detail from Amazon 216 0
Python BeautifulSoup: Scape Internship from Internshala 165 0
Python BeautifulSoup.Tag.find_previous() and Beautiful.Tag.find_all_previous() 20 0
Python BeautifulSoup.Tag.find_next() and BeautifulSoup.Tag.find_all_next() 18 0
Python BeautifulSoup.Tag.find_previous_siblings() and BeautifulSoup.Tag.find_previous_sibling() 27 0
Python BeautifulSoup.Tag.find_next_sibling() and BeautifulSoup.Tag.find_next_siblings() 33 0
Python BeautifulSoup.Tag.find_parent() and BeautifulSoup.Tag.find_parents() 29 0
Python BeautifulSoup.find() 23 0
Python logging.Handler.addFilter() 27 0
Python logging.Handler.removeFilter() 16 0
Beautiful Soup Searching Parse Tree with find_all() 28 0
Beautiful Soup Navigating Parse Tree by Going Back and Forth 21 0
Beautiful Soup Navigating Parse Tree by Going Sideways 22 1
Beautiful Soup Navigating Parse Tree by Going Down 15 0
Beautiful Soup Navigating Parse Tree by Going Up 11 0
Beautiful Soup with NavigableString ,comments and other special string 41 0
Beautiful Soup with tag object 25 0
Python Beautiful Soup introduction 47 0
Python logging.config.dictConfig() 38 0
Python logging.config.fileConfig() 29 0
Python configuring logging 29 0
Python logging.getLogger().hasHandlers() 31 0
Python logging.Filter() 27 0
Python logging.FileHandler() 17 0
Python logging.Handler.setFormatter() 19 0
logging logging.StreamHandler() 25 0
Python logging.Formatter() 18 0
Python logging.getLogger().removeHandler(handler) 39 0
python logging.getLogger().addHandler(handler) 16 0
Python handlers in logging 30 0
Python logging.getLogger().getChild(suffix) 21 0
Python logging.getLogger().isEnabledFor(level) 13 0
python logging.getLogger().setLevel() 20 0
Python logging.log() 25 0
Python logging.exception() 25 0
Python logging method of logger object 17 0
python logging.getLogger().getEffectivelevel() 24 1
python logging.getLogger() 23 0
Python logging.getLogRecordFactory() 27 0
Python logging.basicConfig() 46 0
Python logging introduction 134 0

Comments