doublep / logview

Emacs mode for viewing log files
GNU General Public License v3.0
153 stars 18 forks source link

Support closer-to-ISO-8601 format for timestamps #24

Closed dakrone closed 6 years ago

dakrone commented 6 years ago

When selecting a timestamp, it looks like the ISO-8601 format is not supported. For instance, a date like:

2017-09-15T20:23:45,029

Which is yyyy-mm-ddTHH:mm:ss,SSS

It's quite common to have the T indicator separating the date and time, however this is not one of the supported options.

Also, when I try to manually enter it (the format above) after selecting SLF4J as the mode, I get the following:

Debugger entered--Lisp error: (error "Internal error initializing submode ‘SLF4J’")
  signal(error ("Internal error initializing submode ‘SLF4J’"))
  error("Internal error initializing submode `%s'" "SLF4J")
  logview-choose-submode("SLF4J")
  funcall-interactively(logview-choose-submode "SLF4J")
  call-interactively(logview-choose-submode nil nil)
  command-execute(logview-choose-submode)
dakrone commented 6 years ago

It's worth noting I also get this warning:

Warning (emacs): In Java timestamp pattern ’yyyy-MM-ddTHH:mm:ss,SSS’: Illegal pattern character ‘T’

However, an example logline looks like:

[2017-09-15T20:23:38,495][INFO ][o.e.n.Node               ] [foo] initializing ...

So the T is actually a character (and valid as part of ISO-8601)

doublep commented 6 years ago

You should put single quotes around the literal character, like this:

yyyy-mm-dd'T'HH:mm:ss,SSS
dakrone commented 6 years ago

Thanks, that does indeed work!

doublep commented 6 years ago

It should still accept 'T' and decimal comma by default.