mirror of
https://github.com/gsi-upm/soil
synced 2024-11-22 19:22:29 +00:00
Logs fixed
This commit is contained in:
parent
788af57da2
commit
6548254fe1
14
server.py
14
server.py
@ -89,7 +89,7 @@ class SocketHandler(tornado.websocket.WebSocketHandler):
|
|||||||
elif msg['type'] == 'get_trial':
|
elif msg['type'] == 'get_trial':
|
||||||
if self.application.verbose:
|
if self.application.verbose:
|
||||||
logger.info('Trial {} requested!'.format(msg['data']))
|
logger.info('Trial {} requested!'.format(msg['data']))
|
||||||
self.send_log('INFO.user', 'Trial {} requested!'.format(msg['data']))
|
self.send_log('INFO.' + __name__, 'Trial {} requested!'.format(msg['data']))
|
||||||
self.write_message({'type': 'get_trial',
|
self.write_message({'type': 'get_trial',
|
||||||
'data': self.get_trial( int(msg['data']) ) })
|
'data': self.get_trial( int(msg['data']) ) })
|
||||||
|
|
||||||
@ -154,16 +154,16 @@ class SocketHandler(tornado.websocket.WebSocketHandler):
|
|||||||
with self.logging(self.application.simulator.name):
|
with self.logging(self.application.simulator.name):
|
||||||
try:
|
try:
|
||||||
self.simulation = self.application.simulator.run(self.config)
|
self.simulation = self.application.simulator.run(self.config)
|
||||||
|
trials = []
|
||||||
|
for i in range(self.config['num_trials']):
|
||||||
|
trials.append('{}_trial_{}'.format(self.name, i))
|
||||||
|
self.write_message({'type': 'trials',
|
||||||
|
'data': trials })
|
||||||
except:
|
except:
|
||||||
error = 'Something went wrong. Please, try again.'
|
error = 'Something went wrong. Please, try again.'
|
||||||
self.write_message({'type': 'error',
|
self.write_message({'type': 'error',
|
||||||
'error': error})
|
'error': error})
|
||||||
|
self.send_log('ERROR.' + self.application.simulator.name, error)
|
||||||
trials = []
|
|
||||||
for i in range(self.config['num_trials']):
|
|
||||||
trials.append('{}_trial_{}'.format(self.name, i))
|
|
||||||
self.write_message({'type': 'trials',
|
|
||||||
'data': trials })
|
|
||||||
|
|
||||||
def get_trial(self, trial):
|
def get_trial(self, trial):
|
||||||
G = self.simulation[trial].history_to_graph()
|
G = self.simulation[trial].history_to_graph()
|
||||||
|
Loading…
Reference in New Issue
Block a user