Commit d864a94e authored by ibuler's avatar ibuler

[Update] 添加debug信息

parent 6297328b
...@@ -191,6 +191,7 @@ class Coco: ...@@ -191,6 +191,7 @@ class Coco:
check_session_idle_too_long(s) check_session_idle_too_long(s)
except Exception as e: except Exception as e:
logger.error("Unexpected error occur: {}".format(e)) logger.error("Unexpected error occur: {}".format(e))
logger.error(e, exc_info=True)
time.sleep(interval) time.sleep(interval)
thread = threading.Thread(target=func) thread = threading.Thread(target=func)
thread.start() thread.start()
......
...@@ -110,9 +110,7 @@ class ElFinderConnector: ...@@ -110,9 +110,7 @@ class ElFinderConnector:
func() func()
except Exception as e: except Exception as e:
self.response['error'] = '%s' % e self.response['error'] = '%s' % e
logger.error("Error occur ------------------------------") logger.error(e, exc_info=True)
logger.exception(e)
logger.error("Error end ------------------------------")
def get_request_data(self): def get_request_data(self):
data_source = {} data_source = {}
......
...@@ -87,6 +87,7 @@ class ProxyNamespace(BaseNamespace): ...@@ -87,6 +87,7 @@ class ProxyNamespace(BaseNamespace):
forwarder.proxy() forwarder.proxy()
except Exception as e: except Exception as e:
logger.error("Unexpected error occur: {}".format(e)) logger.error("Unexpected error occur: {}".format(e))
logger.error(e, exc_info=True)
self.logout(client_id, connection) self.logout(client_id, connection)
self.socketio.start_background_task(proxy) self.socketio.start_background_task(proxy)
...@@ -175,7 +176,7 @@ class ProxyNamespace(BaseNamespace): ...@@ -175,7 +176,7 @@ class ProxyNamespace(BaseNamespace):
try: try:
self.on_logout(client_id) self.on_logout(client_id)
except Exception as e: except Exception as e:
logger.warn(e) logger.error(e, exc_info=True)
Connection.remove_connection(connection.id) Connection.remove_connection(connection.id)
def logout(self, client_id, connection): def logout(self, client_id, connection):
......
...@@ -326,7 +326,7 @@ class BaseServer(object): ...@@ -326,7 +326,7 @@ class BaseServer(object):
self.s_parse_input_output_filter(data) self.s_parse_input_output_filter(data)
data = self.s_filter_cmd_filter(data) data = self.s_filter_cmd_filter(data)
except Exception as e: except Exception as e:
logger.exception(e) logger.error(e, exc_info=True)
return self.chan.send(data) return self.chan.send(data)
def recv(self, size): def recv(self, size):
......
...@@ -35,6 +35,7 @@ def convert_error(func): ...@@ -35,6 +35,7 @@ def convert_error(func):
error = e error = e
response = SFTP_EOF response = SFTP_EOF
except Exception as e: except Exception as e:
logger.error(e, exc_info=True)
error = e error = e
response = SFTP_FAILURE response = SFTP_FAILURE
finally: finally:
......
...@@ -102,6 +102,7 @@ class SSHServer: ...@@ -102,6 +102,7 @@ class SSHServer:
logger.warning("Handle connection EOF Error: {}".format(e)) logger.warning("Handle connection EOF Error: {}".format(e))
except Exception as e: except Exception as e:
logger.error("Unexpect error occur on handle connection: {}".format(e)) logger.error("Unexpect error occur on handle connection: {}".format(e))
logger.error(e, exc_info=True)
finally: finally:
Connection.remove_connection(connection.id) Connection.remove_connection(connection.id)
sock.close() sock.close()
......
...@@ -463,7 +463,7 @@ def ignore_error(func): ...@@ -463,7 +463,7 @@ def ignore_error(func):
resp = func(*args, **kwargs) resp = func(*args, **kwargs)
return resp return resp
except Exception as e: except Exception as e:
logger.error("Error occur: {} {}".format(func.__name__, e)) logger.error(e, exc_info=True)
return wrapper return wrapper
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment