Changeset c04fb72 in sasview for sasview/logger_config.py
- Timestamp:
- Apr 10, 2017 7:33:54 AM (7 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 2a8b4756
- Parents:
- 63c7d581
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasview/logger_config.py
r38beeab rc04fb72 9 9 import os 10 10 import os.path 11 import pkg_resources 11 12 12 13 class SetupLogger(object): … … 16 17 17 18 def __init__(self, logger_name): 18 self.config_file = os.path.join(os.path.abspath( 19 os.path.dirname(__file__)), 'logging.ini') 19 self._find_config_file() 20 20 self.name = logger_name 21 21 … … 52 52 for name, _ in logging.Logger.manager.loggerDict.items(): 53 53 logging.getLogger(name).setLevel(logging.DEBUG) 54 55 def _find_config_file(self, filename="logging.ini"): 56 ''' 57 ''' 58 for filepath in [ 59 os.path.join(os.path.abspath(os.path.dirname(__file__)), filename), 60 pkg_resources.resource_filename(__name__, filename), 61 ]: 62 if os.path.exists(filepath): 63 self.config_file = filepath 64 return 65 raise Exception("%s not found...", filename) 66
Note: See TracChangeset
for help on using the changeset viewer.