mirror of
https://github.com/nicolargo/glances.git
synced 2024-09-20 09:08:37 +03:00
Minimal compatibility for logging feature and Python 2.6
This commit is contained in:
parent
e4a91eb462
commit
aeee86d6c9
@ -10,7 +10,6 @@ install:
|
||||
- pip install coveralls
|
||||
script:
|
||||
- python setup.py install
|
||||
- python unitest.py
|
||||
- coverage run --source=glances unitest.py
|
||||
after_success:
|
||||
- coveralls
|
@ -72,5 +72,12 @@ LOGGING_CFG = {
|
||||
|
||||
def glancesLogger():
|
||||
_logger = logging.getLogger()
|
||||
logging.config.dictConfig(LOGGING_CFG)
|
||||
try:
|
||||
logging.config.dictConfig(LOGGING_CFG)
|
||||
except AttributeError:
|
||||
# dictConfig is only available for Python 2.7 or higher
|
||||
# Minimal configuration for Python 2.6
|
||||
logging.basicConfig(filename=os.path.join(tempfile.gettempdir(), 'glances.log'),
|
||||
level=logging.DEBUG,
|
||||
format='%(asctime)s -- %(levelname)s -- %(message)s')
|
||||
return _logger
|
||||
|
Loading…
Reference in New Issue
Block a user