mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Use nano-second time stamp granularity in the debug log
It's overkill for most purposes, but I'd say it doesn't hurt to have the extra resolution available in the raw JSON data for the few cases where it's useful. Have "lazygit -l" print them with milli-second resolution; that seems to be a good middle ground.
This commit is contained in:
parent
1248ac4457
commit
d298a7ce4b
|
|
@ -4,6 +4,7 @@ import (
|
|||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
|
@ -49,7 +50,7 @@ func NewDevelopmentLogger(logPath string) *logrus.Entry {
|
|||
func formatted(log *logrus.Logger) *logrus.Entry {
|
||||
// highly recommended: tail -f development.log | humanlog
|
||||
// https://github.com/aybabtme/humanlog
|
||||
log.Formatter = &logrus.JSONFormatter{}
|
||||
log.Formatter = &logrus.JSONFormatter{TimestampFormat: time.RFC3339Nano}
|
||||
|
||||
return log.WithFields(logrus.Fields{})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/aybabtme/humanlog"
|
||||
)
|
||||
|
|
@ -15,6 +16,7 @@ func TailLogs(logFilePath string) {
|
|||
|
||||
opts := humanlog.DefaultOptions
|
||||
opts.Truncates = false
|
||||
opts.TimeFormat = time.StampMilli
|
||||
|
||||
_, err := os.Stat(logFilePath)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue