diff options
author | Yoichi Hariguchi <yoichi.hariguchi@ntti3.io> | 2018-11-07 18:31:18 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-11-09 09:52:51 +0900 |
commit | 6cc82ff503eccddca54078c97ca1556d2da2ea03 (patch) | |
tree | 175ed3910cc51e00231331b0d93a795640e747f7 /cmd | |
parent | 809f941df96effc326362f63bbdbd05d3335f689 (diff) |
added timestamp
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gobgp/monitor.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cmd/gobgp/monitor.go b/cmd/gobgp/monitor.go index 80bd2b8c..10af9b22 100644 --- a/cmd/gobgp/monitor.go +++ b/cmd/gobgp/monitor.go @@ -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) } } }, |