mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
added timestamp
This commit is contained in:
committed by
FUJITA Tomonori
parent
809f941df9
commit
6cc82ff503
@@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
@@ -79,9 +80,11 @@ func monitorRoute(pathList []*api.Path, showIdentifier bgp.BGPAddPathMode) {
|
||||
pathStrs = append(pathStrs, makeMonitorRouteArgs(p, showIdentifier))
|
||||
}
|
||||
|
||||
format := "[%s] %s via %s aspath [%s] attrs %s\n"
|
||||
if showIdentifier != bgp.BGP_ADD_PATH_NONE {
|
||||
format = "[%s] %d:%s via %s aspath [%s] attrs %s\n"
|
||||
format := time.Now().UTC().Format(time.RFC3339)
|
||||
if showIdentifier == bgp.BGP_ADD_PATH_NONE {
|
||||
format += " [%s] %s via %s aspath [%s] attrs %s\n"
|
||||
} else {
|
||||
format += " [%s] %d:%s via %s aspath [%s] attrs %s\n"
|
||||
}
|
||||
for _, pathStr := range pathStrs {
|
||||
fmt.Printf(format, pathStr...)
|
||||
@@ -167,7 +170,7 @@ func newMonitorCmd() *cobra.Command {
|
||||
if s.Conf.NeighborInterface != "" {
|
||||
addr = fmt.Sprintf("%s(%s)", addr, s.Conf.NeighborInterface)
|
||||
}
|
||||
fmt.Printf("[NEIGH] %s fsm: %s admin: %s\n", addr, s.State.SessionState, s.State.AdminState)
|
||||
fmt.Printf("%s [NEIGH] %s fsm: %s admin: %s\n", time.Now().UTC().Format(time.RFC3339), addr, s.State.SessionState, s.State.AdminState)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user