mirror of
https://github.com/dpup/meshstream.git
synced 2026-03-28 17:42:37 +01:00
- Add .logista.yaml configuration for prettier log output - Add github.com/dpup/logista as a go tool - Update Makefile run target to pipe output through logista - Configure the format to show timestamp, level, and message with colors - Add special formatting for different message types - Display telemetry and position data in readable format - Add table display for remaining structured fields
39 lines
1.5 KiB
YAML
39 lines
1.5 KiB
YAML
# Meshstream Logista Configuration
|
|
format: |
|
|
{{ $timestamp := .timestamp | date | color "blue" }}
|
|
{{ $level := .level | colorByLevel .level | bold }}
|
|
{{ $logger := .logger | dim }}
|
|
{{ $message := .msg }}
|
|
|
|
{{ $timestamp }} {{ $level }} [{{ $logger }}] {{ $message }}
|
|
|
|
{{- if .from }}
|
|
{{ "From:" | dim }} {{ .from }} {{ "To:" | dim }} {{ .to -}}
|
|
{{- if .portNum }} {{ "Type:" | dim }} {{ .portNum | color "magenta" }}{{ end -}}
|
|
{{- if .channel }} {{ "Channel:" | dim }} {{ .channel | color "green" }}{{ end -}}
|
|
{{- if .gateway }} {{ "Gateway:" | dim }} {{ .gateway | color "yellow" }}{{ end }}
|
|
{{- end }}
|
|
|
|
{{- if eq .level "error" }}
|
|
{{ if .error }}{{ .error | color "red" }}{{ end }}
|
|
{{- end }}
|
|
|
|
{{- if .message }}
|
|
{{ "Message:" | dim }} {{ .message }}
|
|
{{- end }}
|
|
|
|
{{- if and .latitude .longitude }}
|
|
{{ "Position:" | dim }} {{ .latitude }}, {{ .longitude }}{{ if .altitude }} Alt: {{ .altitude }}m{{ end }}
|
|
{{- end }}
|
|
|
|
{{- if or .temperature .batteryLevel .voltage }}
|
|
{{ "Telemetry:" | dim }}{{ if .temperature }} Temp: {{ .temperature }}°C{{ end }}{{ if .batteryLevel }} Battery: {{ .batteryLevel }}%{{ end }}{{ if .voltage }} Voltage: {{ .voltage }}V{{ end }}
|
|
{{- end }}
|
|
|
|
{{ filter . "timestamp" "level" "logger" "msg" "error" "from" "to" "portNum" "channel" "gateway" "message" "latitude" "longitude" "altitude" "temperature" "batteryLevel" "voltage" | table }}
|
|
|
|
# Date formatting
|
|
date_format: "15:04:05.000"
|
|
|
|
# Handle non-JSON lines
|
|
handle_non_json: true |