doublep / logview

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

problems customising :! can't customise #7

Closed tangrammer closed 7 years ago

tangrammer commented 7 years ago

firstly thanks for this great lib! (keeps emacs wonderful 😄 )

I'm trying to parse this kind of messages 2017-01-24T17:14:03,826 [main] ERROR my.package - my log message but after a while still no lucky could you help me please? this is the config that i tried (just editing current definition) ("ISO 8601 datetime" "yyyy-MM-ddTHH:mm:ss,SSS")

so this is your modified fn

(defvar logview-std-timestamp-formats
  ;; General notices: we silently handle both common decimal
  ;; separators (dot and comma).  In several cases there is optional
  ;; space if the day/hour number is single-digit.
  (let (formats)
    (dolist (data '(("ISO 8601 datetime + millis"  "yyyy-MM-dd HH:mm:ss.SSS}")
                    ("ISO 8601 datetime + micros"  "yyyy-MM-dd HH:mm:ss.SSSSSS")
                    ("ISO 8601 datetime"           "yyyy-MM-ddTHH:mm:ss,SSS")
                    ("ISO 8601 time only + millis" "HH:mm:ss.SSS")
                    ("ISO 8601 time only + micros" "HH:mm:ss.SSSSSS")
                    ("ISO 8601 time only"          "HH:mm:ss")
                    (nil                           "MMM d HH:mm:ss")
                    (nil                           "MMM d h:mm:ss a")
                    (nil                           "h:mm:ss a")))
      (push (list (or (car data) (cadr data)) (cons 'java-pattern (cadr data))) formats)
      (when (car data)
        (nconc (car formats) (list (list 'aliases (cadr data))))))
    (nreverse formats))
  "Alist of standard timestamp formats.
This value is used as the fallback for customizable
`logview-additional-timestamp-formats'.")
tangrammer commented 7 years ago

edited again ^

doublep commented 7 years ago

You need to put the symbol in single quotes: yyyy-MM-dd'T'HH:mm:ss,SSS. The easiest way is to avoid editing any files: just press C-c C-s in a buffer mode and add this pattern to "Logview Additional Timestamp Formats".

tangrammer commented 7 years ago

Thanks, now works!

2017-01-25 19:16 GMT+01:00 Paul Pogonyshev notifications@github.com:

Closed #7 https://github.com/doublep/logview/issues/7.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/doublep/logview/issues/7#event-936583422, or mute the thread https://github.com/notifications/unsubscribe-auth/AAsqtfbRDG-T6ouk1GWELF01FDVZXrUNks5rV5GAgaJpZM4LtPZs .