Watson
Watson copied to clipboard
log VS report
Here is my vision of log vs report functionality.
log pros:
- detailed output (day, start & stop time)
- frames IDs
- chronological order
log contras:
- too wide output (extra newlines, extra formatting)
- no total time!
- chronological order is reversed (why!?)
report pros:
- total time
- tiny output
report contras:
- no details for a specific entry: date, frame id, start / stop time
- enties are sorted in alphabetical order, per entries titles
None suits my needs so I had to modify log output with a wrapper https://github.com/ezbik/scripts/blob/master/watson/watson_log.py
- added total time
- made output more compressed
so after passing vanilla watson log
through my wrapper, it looks like this.
2019-02-27, from 16:03 to 16:13, spent 0:10:02 on [ 0f070cbf @ redirect]
2019-03-21, from 20:11 to 20:31, spent 0:20:05 on [ 4b7edd8d @ parse service autorestart]
2019-04-04, from 16:11 to 16:31, spent 0:20:07 on [ 5f4026c4 @ redirect contact-us]
TOTAL 0:50:14
Hi @ezbik ! Thanks for the report. What do you think about adding a --oneline
option to the Watson log command? If you think it's an interesting idea, are you willing to make a PR that implements it?
I second having a reverse flag for the log option. I just recently found out about the no pager flag, and I think it'd be nice to be able to see the most recent day at the bottom.
@Kevin-Mok there is also issue #271 where the order matter is discussed, but nobody has started to work on it yet.
https://github.com/ezbik/scripts/tree/master/watson
Updated my wrapper. It now includes customer
field.
As for the log order, currently there is --reverse
flag, which works as I want it in regards to dates (the latest date at the top, just like git log
), however, it does not reverse the session order (regardless of --reverse
/--no-reverse
, it is always printed out from oldest to latest, while I’d prefer it to be same as the date order), which is a bit frustrating and hard to look for what I want.
Session order example
// Actual
Wednesday 30 November 2022 (7h 56m 31s)
487d77b 09:29 to 13:27 3h 57m 28s
4d47252 13:27 to 13:38 11m 00s
05a49de 14:00 to 14:06 06m 32s
7783085 14:06 to 14:08 01m 37s
9c91d59 14:18 to 15:07 48m 39s
0aaa5c0 18:31 to 20:43 2h 12m 30s
ae7fbae 20:56 to 21:35 38m 45s
Tuesday 29 November 2022 (4h 23m 8s)
862b196 08:28 to 11:38 3h 10m 23s
5f21f3c 11:40 to 12:45 1h 05m 16s
1cae713 13:26 to 13:34 07m 29s
// Expected
Wednesday 30 November 2022 (7h 56m 31s)
ae7fbae 20:56 to 21:35 38m 45s
0aaa5c0 18:31 to 20:43 2h 12m 30s
9c91d59 14:18 to 15:07 48m 39s
7783085 14:06 to 14:08 01m 37s
05a49de 14:00 to 14:06 06m 32s
4d47252 13:27 to 13:38 11m 00s
487d77b 09:29 to 13:27 3h 57m 28s
Tuesday 29 November 2022 (4h 23m 8s)
1cae713 13:26 to 13:34 07m 29s
5f21f3c 11:40 to 12:45 1h 05m 16s
862b196 08:28 to 11:38 3h 10m 23s
That said, a line per session log format is a nice addition. :+1: