Skip to content
Snippets Groups Projects
Commit 4ea7c32e authored by payno's avatar payno
Browse files

fix rebase typo

parent d84db845
No related branches found
No related tags found
No related merge requests found
...@@ -31,14 +31,11 @@ __license__ = "MIT" ...@@ -31,14 +31,11 @@ __license__ = "MIT"
__date__ = "28/04/2017" __date__ = "28/04/2017"
<<<<<<< HEAD
try: try:
import graypy import graypy
has_graypy = True has_graypy = True
except: except:
has_graypy = False has_graypy = False
=======
>>>>>>> 1ab687cfd... move graypy handler from from the OWClient to move it in the launcher side
from .config import grayport_port, grayport_host from .config import grayport_port, grayport_host
import os import os
import socket import socket
...@@ -68,37 +65,6 @@ class OWClient(object): ...@@ -68,37 +65,6 @@ class OWClient(object):
_logger.warning('unknow host %s' % grayport_host) _logger.warning('unknow host %s' % grayport_host)
_INFO_UNKNOWN_HOST_NAME = True _INFO_UNKNOWN_HOST_NAME = True
return return
<<<<<<< HEAD
if type(loggers) not in (list, tuple):
loggers = (loggers, )
if not has_graypy:
_logger.info('graypy not install. No log will be send to graylog')
return
for logger in loggers:
if os.environ.get('ORANGE_WEB_LOG', 'True') == 'True':
if hasattr(graypy, 'GELFHandler'):
constructor = graypy.GELFHandler
elif hasattr(graypy, 'GELFUDPHandler'):
constructor = graypy.GELFUDPHandler
else:
logger.warning('Fail to find the correct constructor from graypy')
return
try:
self.graylogHandler = constructor(grayport_host, grayport_port)
except:
if OWClient._log_graylog_err:
logger.warning('Fail to create GELFHandler. Won\'t report log message')
OWClient._log_graylog_err = False
else:
logger.addHandler(self.graylogHandler)
logger.debug('- add graypy handler')
else:
info = 'No log will be send to graylog.'
info += 'ORANGE_WEB_LOG variable is setted to False'
logger.debug(info)
=======
>>>>>>> 1ab687cfd... move graypy handler from from the OWClient to move it in the launcher side
@staticmethod @staticmethod
def _knows_hostname(hostname): def _knows_hostname(hostname):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment