Charles M.C. Chan
Committed by Gerrit Code Review

Log tools improvement

- Add 'olo' command to filter log of remote ONOS instance
- Modify 'onos-log' such that it can run on OSX

Change-Id: Iddab996564af01672c14caca725397c574267bad
...@@ -58,10 +58,15 @@ alias tl='$ONOS_ROOT/tools/dev/bin/onos-local-log' ...@@ -58,10 +58,15 @@ alias tl='$ONOS_ROOT/tools/dev/bin/onos-local-log'
58 alias ll='less $KARAF_LOG' 58 alias ll='less $KARAF_LOG'
59 alias gl='grep $KARAF_LOG --colour=auto -E -e ' 59 alias gl='grep $KARAF_LOG --colour=auto -E -e '
60 60
61 -function filterLog { 61 +function filterLocalLog {
62 tl | grep --colour=always -E -e "${1-org.onlab|org.onosproject}" 62 tl | grep --colour=always -E -e "${1-org.onlab|org.onosproject}"
63 } 63 }
64 -alias tlo='filterLog' 64 +alias tlo='filterLocalLog'
65 +
66 +function filterLog {
67 + ol | grep --colour=always -E -e "${1-org.onlab|org.onosproject}"
68 +}
69 +alias olo='filterLog'
65 70
66 # Pretty-print JSON output 71 # Pretty-print JSON output
67 alias pp='python -m json.tool' 72 alias pp='python -m json.tool'
......
...@@ -31,7 +31,7 @@ else ...@@ -31,7 +31,7 @@ else
31 while true; do 31 while true; do
32 echo ================================================================== 32 echo ==================================================================
33 [ ! -f $LOG ] && sleep 2 && continue 33 [ ! -f $LOG ] && sleep 2 && continue
34 - tail -n 512 --follow=name $LOG --pid \$$ --sleep-interval 2 34 + tail -n 512 -f -F $LOG
35 done 35 done
36 " 36 "
37 fi 37 fi
......