Closed rnikander closed 5 months ago
Seems to work fine for me, tested with your log example.
If you evaluate (M-:
) expression (not (null logview--submode-timestamp-parser))
in the log buffer, what does it say?
What are the version of Logview and library datetime
? What is your OS? Can you restart Emacs and try again (there could be some artifacts in case you upgraded the packages)?
If you evaluate (
M-:
) expression(not (null logview--submode-timestamp-parser))
in the log buffer, what does it say?
It says nil
.
Other commands are working and the modeline says (Logview/SLF4J ivy)
.
What are the version of Logview and library
datetime
? What is your OS? Can you restart Emacs and try again (there could be some artifacts in case you upgraded the packages)?
I restarted Emacs and it's still doing it, but I bet I messed something up with install. I had problems where the install from MELPA was failing and I downloaded some stuff manually.
logview.el
says: ;; Version: 0.17.4snapshot
datetime.el
says: ;; Version: 0.10.1snapshot
My OS is Windows 11 Home.
Well, I then suggest you try to reinstall the packages, just in case.
But if that doesn't help:
logview--submode-features
, logview--timestamp-difference-format-string
in the log buffer;(datetime--determine-system-timezone)
, (not (null (datetime-parser-to-float 'java "yyyy-MM-dd" :timezone 'system)))
.Deleted the packages logview
and datetime
. Restarted Emacs. Installed logview
using the package manager (which also installed datetime). Opened my log file. Tried z a
, got same error.
By the way, is a log file supposed to automatically go into read-only mode? When I open my main.log
file, it seems to be recognized by logview
but I need to run read-only-mode
myself.
Anyway, here I tried to evaluate the forms you mention, using M-:
in the log buffer. The last two trigger errors.
logview--submode-features
=> (name level thread timestamp)
logview--timestamp-difference-format-string
=> nil
(datetime--determine-system-timezone) =>
Debugger entered--Lisp error: (error "Failed to determine system timezone (found raw val...")
error("Failed to determine system timezone%s; consider cu..." " (found raw value: ‘Central Standard Time (Mexico)...")
datetime--determine-system-timezone()
eval-expression((datetime--determine-system-timezone) nil nil 127)
funcall-interactively(eval-expression (datetime--determine-system-timezone) nil nil 127)
command-execute(eval-expression)
(not (null (datetime-parser-to-float 'java "yyyy-MM-dd" :timezone 'system))) =>
Debugger entered--Lisp error: (error "Failed to determine system timezone (found raw val...")
error("Failed to determine system timezone%s; consider cu..." " (found raw value: ‘Central Standard Time (Mexico)...")
datetime--determine-system-timezone()
datetime--get-timezone((:timezone system))
datetime-parser-to-float(java "yyyy-MM-dd" :timezone system)
(null (datetime-parser-to-float 'java "yyyy-MM-dd" :timezone 'system))
(not (null (datetime-parser-to-float 'java "yyyy-MM-dd" :timezone 'system)))
eval-expression((not (null (datetime-parser-to-float 'java "yyyy-MM-dd" :timezone 'system))) nil nil 127)
funcall-interactively(eval-expression (not (null (datetime-parser-to-float 'java "yyyy-MM-dd" :timezone 'system))) nil nil 127)
command-execute(eval-expression)
By the way, is a log file supposed to automatically go into read-only mode?
Yes.
Reproduced this locally now by making datetime--determine-system-timezone
signal an error.
Do you get warnings "⛔ Warning (emacs): Failed to determine system timezone...; consider customizing ‘datetime-timezone’ variable" somewhere in Emacs?
What is the value of (current-time-zone)
?
As a workaround you can do (setf datetime-timezone 'Mexico/General)
or whatever is appropriate for you (see documentation of the variable). However, I'll try to improve situation here.
I looked in *Messages*
and I don't see that warning. I customized that variable (datetime-timezone
) to have the value America/Mexico_City
and now the z a
command works, and the file opens in a read-only buffer. Nice!
The call to (current-time-zone)
returns: (-21600 "Central Standard Time (Mexico)")
Thanks for creating this. I've been working on a C++ code base, and all the logging to console had gotten out of control. Now I log to a file and use this package to view the file - it's a big improvement.
I looked in Messages and I don't see that warning.
Here (Emacs 29.3 on Linux) the warnings don't go to buffer *Messages*
, but to their own buffer *Warnings*
. This buffer also automatically pops up on the first (or maybe any) warning. But I have no idea how it should work in your case, this is not part of Logview, it just uses the provided warning system.
I will certainly improve Logview to cope with such situations better and will also try to have datetime
's timezone autodetermining handle this ("Central Standard Time (Mexico)"). On Linux it's easy because timezone names are exactly how the library has them in its database, but on Windows the same timezones are named differently...
Logview improvements have been released in 0.17.4.
I recently installed logview and I'm experimenting with different commands. If I type
z a
, I get an error.Example log:
z a
on that first line leads to: