You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/05/20 01:22:14 UTC
[05/13] incubator-mynewt-newt git commit: Changing structures and
removing PERUSER
Changing structures and removing PERUSER
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/5c938a59
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/5c938a59
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/5c938a59
Branch: refs/heads/develop
Commit: 5c938a59716978909aab566a27b9bee60df12434
Parents: 4e34c08
Author: Vipul Rahane <vi...@runtime.io>
Authored: Fri Apr 22 19:19:47 2016 -0700
Committer: Vipul Rahane <vi...@runtime.io>
Committed: Tue May 17 12:39:53 2016 -0700
----------------------------------------------------------------------
newtmgr/cli/logs.go | 12 +++---------
newtmgr/protocol/logs.go | 18 ++++--------------
2 files changed, 7 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/5c938a59/newtmgr/cli/logs.go
----------------------------------------------------------------------
diff --git a/newtmgr/cli/logs.go b/newtmgr/cli/logs.go
index 7b16f62..bd26724 100644
--- a/newtmgr/cli/logs.go
+++ b/newtmgr/cli/logs.go
@@ -36,8 +36,7 @@ const (
LEVEL_ERROR uint64 = 3
LEVEL_CRITICAL uint64 = 4
/* Upto 7 custom loglevels */
- LEVEL_PERUSER uint64 = 64
- LEVEL_MAX uint64 = 255
+ LEVEL_MAX uint64 = 255
)
const (
@@ -53,7 +52,6 @@ const (
MODULE_NIMBLE_CTLR uint64 = 3
MODULE_NIMBLE_HOST uint64 = 4
MODULE_NFFS uint64 = 5
- MODULE_PERUSER uint64 = 64
MODULE_MAX uint64 = 255
)
@@ -72,8 +70,6 @@ func LogModuleToString(lm uint64) string {
s = "NIMBLE_HOST"
case MODULE_NFFS:
s = "NFFS"
- case MODULE_PERUSER:
- s = "PERUSER"
default:
s = "CUSTOM"
}
@@ -93,8 +89,6 @@ func LoglevelToString(ll uint64) string {
s = "ERROR"
case LEVEL_CRITICAL:
s = "CRITICAL"
- case LEVEL_PERUSER:
- s = "PERUSER"
default:
s = "CUSTOM"
}
@@ -238,7 +232,7 @@ func logsModuleListCmd(cmd *cobra.Command, args []string) {
nmUsage(cmd, err)
}
- fmt.Println(decodedResponse.ModuleList)
+ fmt.Println(decodedResponse.Map)
fmt.Printf("Return Code = %d\n", decodedResponse.ReturnCode)
}
@@ -288,7 +282,7 @@ func logsLevelListCmd(cmd *cobra.Command, args []string) {
nmUsage(cmd, err)
}
- fmt.Println(decodedResponse.LevelList)
+ fmt.Println(decodedResponse.Map)
fmt.Printf("Return Code = %d\n", decodedResponse.ReturnCode)
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/5c938a59/newtmgr/protocol/logs.go
----------------------------------------------------------------------
diff --git a/newtmgr/protocol/logs.go b/newtmgr/protocol/logs.go
index 67f00cd..327e79f 100644
--- a/newtmgr/protocol/logs.go
+++ b/newtmgr/protocol/logs.go
@@ -56,29 +56,19 @@ type LogsShowLog struct {
Entries []LogEntry `json:"entries"`
}
-type LogsModuleList struct {
- ModuleName string `json:"module_name"`
- Module uint64 `json:"module"`
-}
-
-type LogsLevelList struct {
- LevelName string `json:"level_name"`
- Level uint64 `json:"level"`
-}
-
type LogsShowRsp struct {
ReturnCode int `json:"rc"`
Logs []LogsShowLog `json:"logs"`
}
type LogsModuleListRsp struct {
- ReturnCode int `json:"rc"`
- ModuleList []LogsModuleList `json:"log_module_map"`
+ ReturnCode int `json:"rc"`
+ Map map[string]int `json:"module_map"`
}
type LogsLevelListRsp struct {
- ReturnCode int `json:"rc"`
- LevelList []LogsLevelList `json:"log_level_map"`
+ ReturnCode int `json:"rc"`
+ Map map[string]int `json:"level_map"`
}
func NewLogsShowReq() (*LogsShowReq, error) {