def get_logger_name_for_module(module):
 module_file = module.__file__
 base_dir = os.path.dirname(os.path.abspath(module_file))
 module_name = os.path.basename(module_file)
 module_name = module_name.replace('.pyc', '').replace('.py', '')
 split = base_dir.split(os.path.sep)
 split = [component for component in split if component]
 start_index = 0
 for (index, component) in enumerate(reversed(split)):
  if component.startswith('st2'):
   start_index = ((len(split) - 1) - index)
   break
 split = split[start_index:]
 name = (('.'.join(split) + '.') + module_name)
 return name

def get_logger_name_for_module ( module ) : module_file = module . __file__ base_dir = os . path . dirname ( os . path . abspath ( module_file ) ) module_name = os . path . basename ( module_file ) module_name = module_name . replace ( '.pyc' , '' ) . replace ( '.py' , '' ) split = base_dir . split ( os . path . sep ) split = [ component for component in split if component ] start_index = 0 for ( index , component ) in enumerate ( reversed ( split ) ) : if component . startswith ( 'st2' ) : start_index = ( ( len ( split ) - 1 ) - index ) break split = split [ start_index : ] name = ( ( '.' . join ( split ) + '.' ) + module_name ) return name
retrieve fully qualified logger name for current module :type: str .