meeshkan / hmt

HTTP Mocking Toolkit
MIT License
52 stars 7 forks source link

Shorten log format #126

Closed fornwall closed 4 years ago

fornwall commented 4 years ago

Before

$ meeshkan record
2020-03-11 15:16:25,205 - meeshkan.serve.admin.runner - INFO - Starting admin endpont on http://localhost:8888/admin
2020-03-11 15:16:25,205 - meeshkan.serve.record.proxy - INFO - Starting Meeshkan record on http://localhost:8000
2020-03-11 15:16:25,205 - meeshkan.serve.record.proxy - INFO - Spec generation mode is disabled

After:

$ meeshkan record
Starting admin endpoint on http://localhost:8888/admin
Starting Meeshkan record on http://localhost:8000
Spec generation mode is disabled

Future improvements could be adding color and/or emojis to make the output come alive a bit.

ksaaskil commented 4 years ago

Yes it's a very good idea to simplify console logs! Maybe I would still like to have a bit more information in the file system logs going to ~/.meeshkan/logs, maybe we could add a separate formatter for separate handlers?

fornwall commented 4 years ago

@ksaaskil I've updated to have the existing log format when logging to files, and the shortened format when logging to the terminal.

So this is shown in the terminal:

Mock is listening on http://localhost:8000

And this is logged to the files:

2020-03-16 10:44:23,875 - meeshkan.serve.mock.server - INFO - Mock is listening on http://localhost:8000

As a follow up in upcoming PRs we'll investigate adding coloured logging in the terminal and perhaps some emojis for statuses to make it come more alive and be more distinctive.