Query logbook for time tracked tasks

I would like to expand on Enhancement request: Add close timestamp for TODO lists, org-mode style · Issue #5825 · logseq/logseq · GitHub. I don’t know if this needs a huge amount of work, but the functionality I’m looking for is the ability to create reports for time tracked tasks.

It’s a feature for time keeping for freelance projects. see context here Help with time tracking management and reports.

What I’m looking for is this:

  • insert tasks in non-journal pages for time tracking purposes. They’re dedicated project page tasks
  • be able to query these tasks and get a report for time tracked say for the last months or between certain dates.
  • the report should include tracked time per day and total time tracked for the given period at the very least

This combined with filtering tasks would make for a very useful time-tracking tool.

I tried https://taskwarrior.org/ for a while, but it’s overly-complicated for my needs at least. For now I’m using a tool called unfog which gives us very simple reports.

Here’s an example:

~ 
❯ unfog

ID   |DESC                                           |PROJECT                            |ACTIVE |DUE |WORKTIME 
65f8 |GDQuest Support                                |gdquest-support                    |       |    |13 hours 
4e03 |GDQuest Node Essentials Port to Godot v4       |gdquest-node-essentials-port       |       |    |1 day    
3a64 |GDQuest Procedural Generation Port to Godot v4 |gdquest-procedural-generation-port |       |    |2 hours  


~ 
❯ unfog w --from 2023-03-01
DATE       |WORKTIME               
2023-03-01 |46 mins                
2023-03-02 |25 mins                
2023-03-08 |8 hours 4 mins         
2023-03-09 |6 hours 40 mins        
2023-03-10 |9 hours 3 mins         
2023-03-16 |7 hours 27 mins        
2023-03-17 |6 hours 45 mins        
2023-03-18 |7 hours 4 mins         
—          |—                      
TOTAL RAW  |1 day 22 hours 16 mins 
TOTAL WDAY |6 days 4 hours 3 mins  


~ 
❯ unfog w --from 2023-03-01 --more
DATE       |ID   |PROJECT                            |DESC                                           |WORKTIME               
2023-03-01 |65f8 |gdquest-support                    |GDQuest Support                                |46 mins                
SUBTOTAL   |     |                                   |                                               |46 mins                
—          |—    |—                                  |—                                              |—                      
2023-03-02 |65f8 |gdquest-support                    |GDQuest Support                                |25 mins                
SUBTOTAL   |     |                                   |                                               |25 mins                
—          |—    |—                                  |—                                              |—                      
2023-03-08 |4e03 |gdquest-node-essentials-port       |GDQuest Node Essentials Port to Godot v4       |7 hours 36 mins        
2023-03-08 |65f8 |gdquest-support                    |GDQuest Support                                |27 mins                
SUBTOTAL   |     |                                   |                                               |8 hours 4 mins         
—          |—    |—                                  |—                                              |—                      
2023-03-09 |4e03 |gdquest-node-essentials-port       |GDQuest Node Essentials Port to Godot v4       |6 hours 19 mins        
2023-03-09 |65f8 |gdquest-support                    |GDQuest Support                                |20 mins                
SUBTOTAL   |     |                                   |                                               |6 hours 40 mins        
—          |—    |—                                  |—                                              |—                      
2023-03-10 |4e03 |gdquest-node-essentials-port       |GDQuest Node Essentials Port to Godot v4       |8 hours 8 mins         
2023-03-10 |65f8 |gdquest-support                    |GDQuest Support                                |54 mins                
SUBTOTAL   |     |                                   |                                               |9 hours 3 mins         
—          |—    |—                                  |—                                              |—                      
2023-03-16 |3a64 |gdquest-procedural-generation-port |GDQuest Procedural Generation Port to Godot v4 |2 hours 42 mins        
2023-03-16 |4e03 |gdquest-node-essentials-port       |GDQuest Node Essentials Port to Godot v4       |4 hours 44 mins        
SUBTOTAL   |     |                                   |                                               |7 hours 27 mins        
—          |—    |—                                  |—                                              |—                      
2023-03-17 |4e03 |gdquest-node-essentials-port       |GDQuest Node Essentials Port to Godot v4       |6 hours 45 mins        
SUBTOTAL   |     |                                   |                                               |6 hours 45 mins        
—          |—    |—                                  |—                                              |—                      
2023-03-18 |4e03 |gdquest-node-essentials-port       |GDQuest Node Essentials Port to Godot v4       |5 hours 27 mins        
2023-03-18 |65f8 |gdquest-support                    |GDQuest Support                                |1 hour 36 mins         
SUBTOTAL   |     |                                   |                                               |7 hours 4 mins         
—          |—    |—                                  |—                                              |—                      
TOTAL RAW  |     |                                   |                                               |1 day 22 hours 16 mins 
TOTAL WDAY |     |                                   |                                               |6 days 4 hours 3 mins  

If it helps, unfog keeps track of tasks in plain text, these are some examples of its “database” entries:

TaskStarted 2023-03-01 20:44:00.91519044 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskStopped 2023-03-01 21:30:30.598257196 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskStarted 2023-03-02 04:41:18.310468042 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskStopped 2023-03-02 05:07:05.759543444 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskEdited 2023-03-02 17:38:43.759231503 UTC "4143caf4-eb86-4e7a-b521-298345d67ef9" "GDQuest Godot v4 Demos - Text and UI: MultiLingual" (Just "gdquest-godot-v4-new-features-multilingual") Nothing
TaskEdited 2023-03-02 17:38:59.625553628 UTC "47e5c4b9-4a66-430c-b7dd-4267a779c220" "GDQuest Godot v4 Demos - Text and UI: Theme Variation" (Just "gdquest-godot-v4-new-features-theme") Nothing
TaskEdited 2023-03-02 17:39:19.202151708 UTC "96a3a6d8-ff39-4b37-b726-2d0a670bceb6" "GDQuest Godot v4 Demos - Physics: 2D Performance Comparisson" (Just "gdquest-godot-v4-new-features-physics") Nothing
TaskEdited 2023-03-02 17:39:33.745916817 UTC "346e67bb-dccb-4096-a4ef-16b35928fc91" "GDQuest Godot v4 Demos - Swarm of Agents" (Just "gdquest-godot-v4-new-features-agents") Nothing
TaskEdited 2023-03-02 17:39:49.147297365 UTC "aac71c4f-d100-4e51-b205-1403eb2d7606" "GDQuest Godot v4 Demos - AnimationTree Audio" (Just "gdquest-godot-v4-new-features-animationtree") Nothing
TaskEdited 2023-03-02 17:40:00.307199582 UTC "133c298e-bb82-4a6f-bfc6-16896a7ef553" "GDQuest Godot v4 Demos - Navigation" (Just "gdquest-godot-v4-new-features-nav") Nothing
TaskEdited 2023-03-02 17:40:21.58777592 UTC "8ffc054d-db11-40fc-a47c-4fb57a456741" "GDQuest Godot v4 Demos - Particles" (Just "gdquest-godot-v4-new-features-particles") Nothing
TaskDid 2023-03-08 05:58:18.963397318 UTC "a9858954-1096-4259-8f8d-b07ca800769b"
TaskDid 2023-03-08 05:58:18.963397318 UTC "4143caf4-eb86-4e7a-b521-298345d67ef9"
TaskDid 2023-03-08 05:58:18.963397318 UTC "47e5c4b9-4a66-430c-b7dd-4267a779c220"
TaskDid 2023-03-08 05:58:18.963397318 UTC "96a3a6d8-ff39-4b37-b726-2d0a670bceb6"
TaskDid 2023-03-08 05:58:18.963397318 UTC "346e67bb-dccb-4096-a4ef-16b35928fc91"
TaskDid 2023-03-08 05:58:18.963397318 UTC "aac71c4f-d100-4e51-b205-1403eb2d7606"
TaskDid 2023-03-08 05:58:18.963397318 UTC "133c298e-bb82-4a6f-bfc6-16896a7ef553"
TaskDid 2023-03-08 05:58:18.963397318 UTC "8ffc054d-db11-40fc-a47c-4fb57a456741"
TaskDid 2023-03-08 05:58:18.963397318 UTC "fc25442e-9d70-4549-9804-8eddc54bf8da"
TaskAdded 2023-03-08 05:59:34.007726957 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881" "GDQuest Node Essentials Port to Godot v4" (Just "gdquest-node-essentials-port") Nothing
TaskStarted 2023-03-08 06:04:20.304508 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-08 07:15:15.037475527 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStarted 2023-03-08 08:07:51.679421349 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-08 13:04:51.462659156 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStarted 2023-03-08 13:40:49.046559915 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-08 15:09:36.598214618 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStarted 2023-03-08 15:09:41.696405255 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskStopped 2023-03-08 15:20:00.267793112 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskStarted 2023-03-08 16:12:11.641486763 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskStopped 2023-03-08 16:29:25.666861131 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskStarted 2023-03-09 05:45:12.866432156 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-09 08:58:19.642558157 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStarted 2023-03-09 10:20:10.471630373 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-09 13:26:34.629108478 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStarted 2023-03-09 13:26:47.564451562 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskStopped 2023-03-09 13:47:29.303774422 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskStarted 2023-03-10 06:02:28.182005416 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-10 11:18:41.136269257 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStarted 2023-03-10 12:05:16.586072283 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-10 14:57:52.510089076 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStarted 2023-03-10 14:57:57.619713084 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskStopped 2023-03-10 15:52:16.037970381 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskStarted 2023-03-16 07:32:05.696721722 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-16 09:30:16.636255475 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskAdded 2023-03-16 09:57:20.040954769 UTC "3a64f9bd-03d7-4f74-98b6-446b219249e0" "GDQuest Node Essentials Port to Godot v4" (Just "gdquest-procedural-generation") Nothing
TaskEdited 2023-03-16 09:57:44.880128249 UTC "3a64f9bd-03d7-4f74-98b6-446b219249e0" "GDQuest Procedural Generation Port to Godot v4" (Just "gdquest-procedural-generation") Nothing
TaskEdited 2023-03-16 09:57:55.743081336 UTC "3a64f9bd-03d7-4f74-98b6-446b219249e0" "GDQuest Procedural Generation Port to Godot v4" (Just "gdquest-procedural-generation-port") Nothing
TaskStarted 2023-03-16 09:58:00.999049235 UTC "3a64f9bd-03d7-4f74-98b6-446b219249e0"
TaskStopped 2023-03-16 10:01:42.887489854 UTC "3a64f9bd-03d7-4f74-98b6-446b219249e0"
TaskStarted 2023-03-16 11:07:11.938244499 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-16 13:53:40.34495113 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStarted 2023-03-16 14:39:48.612004962 UTC "3a64f9bd-03d7-4f74-98b6-446b219249e0"
TaskStopped 2023-03-16 17:18:30.631040851 UTC "3a64f9bd-03d7-4f74-98b6-446b219249e0"
TaskStarted 2023-03-17 10:36:54.401942693 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-17 17:22:01.097110628 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStarted 2023-03-18 05:00:45.554370748 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-18 05:11:31.62898436 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStarted 2023-03-18 05:11:35.917361425 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskStopped 2023-03-18 06:47:45.262102022 UTC "65f8f735-36fd-4aef-a67e-787f274bffb9"
TaskStarted 2023-03-18 07:24:15.333224112 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-18 08:25:28.845110307 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStarted 2023-03-18 09:08:22.42833171 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-18 10:49:56.77374724 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStarted 2023-03-18 11:36:34.998689591 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"
TaskStopped 2023-03-18 14:10:58.910747228 UTC "4e03db64-ac73-4f8c-9d32-61ce735a8881"

The app is written in Haskell that’s why we see stuff like Nothing in there.

Thanks!