Skip to content

Commit fc1f9f1

Browse files
Update electrumx_server logs
1 parent 8afaa1c commit fc1f9f1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

electrumx_server

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# See the file "LICENCE" for information about the copyright
88
# and warranty status of this software.
99

10-
'''Script to kick off the server.'''
10+
"""Script to kick off the server."""
1111

1212
import asyncio
1313
import logging
@@ -24,12 +24,12 @@ load_dotenv()
2424

2525

2626
def main():
27-
'''Set up logging and run the server.'''
27+
"""Set up logging and run the server."""
2828
log_fmt = Env.default('LOG_FORMAT', '%(levelname)s:%(name)s:%(message)s')
2929
log_level = Env.default('LOG_LEVEL', 'INFO').upper()
3030
log_path = Env.default('LOG_PATH', None)
3131
if log_path:
32-
exist =os.path.exists(log_path)
32+
exist = os.path.exists(log_path)
3333
if not exist:
3434
os.makedirs(log_path)
3535
handler = logging.handlers.WatchedFileHandler(log_path + "/electrumx.log")
@@ -48,9 +48,9 @@ def main():
4848
controller = Controller(env)
4949
asyncio.run(controller.run())
5050
except KeyboardInterrupt:
51-
logger.info('ElectrumX server terminated (normally) before initialized')
52-
except Exception:
53-
logger.exception('ElectrumX server terminated abnormally')
51+
logger.info('ElectrumX server terminated by keyboard interrupt')
52+
except Exception as e:
53+
logger.exception(f'ElectrumX server terminated abnormally: {e}')
5454
else:
5555
logger.info('ElectrumX server terminated normally')
5656

0 commit comments

Comments
 (0)