Skip to content

Commit

Permalink
Fix log defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
gagliardetto committed Feb 8, 2024
1 parent 826ac0a commit afc4b35
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The `proxyFailedRequests` flag will make the RPC server proxy not only RPC metho

### Log Levels

You can set the desired log verbosity level by using the `-v` flag. The levels are from 0 to 5, where 0 is the least verbose and 5 is the most verbose. The default level is 3.
You can set the desired log verbosity level by using the `-v` flag. The levels are from 0 to 5, where 0 is the least verbose and 5 is the most verbose. The default level is 2.

Example:

Expand Down
12 changes: 8 additions & 4 deletions klog.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ func NewKlogFlagSet() []cli.Flag {
fs := flag.NewFlagSet("klog", flag.PanicOnError)
klog.InitFlags(fs)

fs.Set("v", "2")
fs.Set("log_file_max_size", "1800")
fs.Set("logtostderr", "true")

return []cli.Flag{
// "log_dir", "", "If non-empty, write log files in this directory (no effect when -logtostderr=true)")
&cli.StringFlag{
Expand Down Expand Up @@ -73,10 +77,10 @@ func NewKlogFlagSet() []cli.Flag {
},
// "v", "number for the log level verbosity")
&cli.IntFlag{
Name: "v",
Usage: "number for the log level verbosity",
EnvVars: []string{"FAITHFUL_V"},
DefaultText: "3",
Name: "v",
Usage: "number for the log level verbosity",
EnvVars: []string{"FAITHFUL_V"},
Value: 2,
Action: func(cctx *cli.Context, v int) error {
fs.Set("v", fmt.Sprint(v))
return nil
Expand Down
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ func main() {
Version: gitCommitSHA,
Description: "CLI to get, manage and interact with the Solana blockchain data stored in a CAR file or on Filecoin/IPFS.",
Flags: NewKlogFlagSet(),
Action: nil,
Before: func(cctx *cli.Context) error {
return nil
},
Action: nil,
Commands: []*cli.Command{
newCmd_DumpCar(),
fetchCmd,
Expand Down

0 comments on commit afc4b35

Please sign in to comment.