Closed The-Sirius-Black closed 2 months ago
When I run :Hardtime report
there are some error message:
Error executing Lua callback: ...al/share/nvim/lazy/hardtime.nvim/lua/hardtime/report.lua:43: field 'day' missing in date table
stack traceback:
[C]: in function 'time'
...al/share/nvim/lazy/hardtime.nvim/lua/hardtime/report.lua:43: in function <...al/share/nvim/lazy/hardtime.nvim/lua/hardtime/report.lua:20>
...l/share/nvim/lazy/hardtime.nvim/lua/hardtime/command.lua:13: in function <...l/share/nvim/lazy/hardtime.nvim/lua/hardtime/command.lua:11>
Can you please send me your input file? I can't reporduce the issue on my input file. Thanks in advance!
Can you please send me your input file? I can't reporduce the issue on my input file. Thanks in advance!
Here you go:
The logging function currently uses the date format settings of the operating system when writing logs to a file.
Therfore your logs and my logs are diffrently formatted.
Windows:
[INFO 18.4.2024. 4:52:27] You pressed the j key too soon! Use [count]j or CTRL-D to scroll down.
Mac:
[INFO Mon Jan 22 09:37:30 2024] The <Right> key is disabled!
Your log example :
[INFO Thu 11 Jan 2024 02:52:04 PM CST] Use O instead of ko
I do not know if i have lack of knowladge on parsing dates in lua but it seems like im in need of some thrid party plugin or
adding date format so when log is written it would be easier to parse.
os.date("%d.%m.%Y %H:%M:%S"),
@The-Sirius-Black it works now. However when I open the report, only the All Time
tab has records and others are all blank.
@m4xshen I added date format os.date("%d.%m.%Y %H:%M:%S")
to function that writes logs. That means that new logs will be written with uniformed date format so I can easly parse it. But old logs within this month will not be shown because all logs have diffrent format I've tried to explain here . They will be shown in All Time
tab.
@The-Sirius-Black Yes I knew that the date format change. So I deleted all old logs and triggered new ones. However they still only display inside the All Time tab.
Example of my new logs:
[INFO 27.04.2024 22:17:05] You pressed the j key too soon! Use [count]j or CTRL-D to scroll down.
[INFO 27.04.2024 22:18:53] You pressed the l key too soon!
[INFO 27.04.2024 22:18:55] Use cw instead of dwi
[INFO 27.04.2024 22:21:58] You pressed the <CR> key too soon!
[INFO 27.04.2024 22:27:30] You pressed the j key too soon! Use [count]j or CTRL-D to scroll down.
[INFO 27.04.2024 22:27:30] You pressed the k key too soon! Use [count]k or CTRL-U to scroll up.
[INFO 27.04.2024 22:27:31] You pressed the j key too soon! Use [count]j or CTRL-D to scroll down.
@m4xshen I've done some refactoring and applied changes.
@The-Sirius-Black Thanks for the PR! It is now merged into dev
and will be merged into main
after some refactor.
#56