Skip to content

Commit 753e187

Browse files
committed
Update legacy peer CLI logging functions
This CR updates the descriptions and logging messages for the legacy peer CLI logging functions to ensure they reflect the new logging configuration. FAB-12490 #done Change-Id: I589a412206d9b8f1ad814bed2eeb6e4a172ec494 Signed-off-by: Will Lahti <wtlahti@us.ibm.com>
1 parent c209841 commit 753e187

File tree

4 files changed

+11
-22
lines changed

4 files changed

+11
-22
lines changed

peer/clilogging/getlevel.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
/*
2-
Copyright IBM Corp. 2016 All Rights Reserved.
2+
Copyright IBM Corp. All Rights Reserved.
33
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
4+
SPDX-License-Identifier: Apache-2.0
155
*/
166

177
package clilogging
@@ -32,7 +22,6 @@ func getLevelCmd(cf *LoggingCmdFactory) *cobra.Command {
3222
return getLevel(cf, cmd, args)
3323
},
3424
}
35-
3625
return loggingGetLevelCmd
3726
}
3827

@@ -60,7 +49,7 @@ func getLevel(cf *LoggingCmdFactory, cmd *cobra.Command, args []string) (err err
6049
if err != nil {
6150
return err
6251
}
63-
logger.Infof("Current log level for peer module '%s': %s", logResponse.LogModule, logResponse.LogLevel)
52+
logger.Infof("Current log level for module '%s': %s", logResponse.LogModule, logResponse.LogLevel)
6453
}
6554
return err
6655
}

peer/clilogging/logging.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616

1717
const (
1818
loggingFuncName = "logging"
19-
loggingCmdDes = "Log levels: getlevel|setlevel|revertlevels."
19+
loggingCmdDes = "Logging configuration: getlevel|setlevel|getlogspec|setlogspec|revertlevels."
2020
)
2121

2222
var logger = flogging.MustGetLogger("cli.logging")

peer/clilogging/revertlevels.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import (
1616
func revertLevelsCmd(cf *LoggingCmdFactory) *cobra.Command {
1717
var loggingRevertLevelsCmd = &cobra.Command{
1818
Use: "revertlevels",
19-
Short: "Reverts the logging levels to the levels at the end of peer startup.",
20-
Long: `Reverts the logging levels to the levels at the end of peer startup`,
19+
Short: "Reverts the logging spec to the peer's spec at startup.",
20+
Long: `Reverts the logging spec to the peer's spec at startup.`,
2121
RunE: func(cmd *cobra.Command, args []string) error {
2222
return revertLevels(cf, cmd, args)
2323
},
@@ -42,7 +42,7 @@ func revertLevels(cf *LoggingCmdFactory, cmd *cobra.Command, args []string) (err
4242
if err != nil {
4343
return err
4444
}
45-
logger.Info("Log levels reverted to the levels at the end of peer startup.")
45+
logger.Info("Logging spec reverted to the peer's spec at startup.")
4646
}
4747
return err
4848
}

peer/clilogging/setlevel.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import (
1515

1616
func setLevelCmd(cf *LoggingCmdFactory) *cobra.Command {
1717
var loggingSetLevelCmd = &cobra.Command{
18-
Use: "setlevel <module regular expression> <log level>",
19-
Short: "Sets the logging level for all modules that match the regular expression.",
20-
Long: `Sets the logging level for all modules that match the regular expression.`,
18+
Use: "setlevel <module> <log level>",
19+
Short: "Adds the module and log level to the current logging spec.",
20+
Long: `Adds the module and log level to the current logging specification.`,
2121
RunE: func(cmd *cobra.Command, args []string) error {
2222
return setLevel(cf, cmd, args)
2323
},
@@ -50,7 +50,7 @@ func setLevel(cf *LoggingCmdFactory, cmd *cobra.Command, args []string) (err err
5050
if err != nil {
5151
return err
5252
}
53-
logger.Infof("Log level set for peer modules matching regular expression '%s': %s", logResponse.LogModule, logResponse.LogLevel)
53+
logger.Infof("Log level set for module name/prefix '%s': %s", logResponse.LogModule, logResponse.LogLevel)
5454
}
5555
return err
5656
}

0 commit comments

Comments
 (0)