3232 }
3333 watch bool
3434 listen string
35+ logLevel = cmdutil.Oneof {
36+ Value : "" ,
37+ Allowed : []string {"trace" , "debug" , "info" , "warn" , "error" },
38+ Flag : "level" ,
39+ FlagShort : "l" ,
40+ Desc : "Minimum log level to display" ,
41+ TypeDesc : "string" ,
42+ }
3543 port uint
3644 jsonLogs bool
3745 browser = cmdutil.Oneof {
4654
4755func init () {
4856 runCmd := & cobra.Command {
49- Use : "run [--debug] [--watch=true] [--port=4000] [--listen=<listen-addr>]" ,
57+ Use : "run [--debug] [--watch=true] [--level=TRACE] [-- port=4000] [--listen=<listen-addr>]" ,
5058 Short : "Runs your application" ,
5159 Args : cobra .NoArgs ,
5260 Run : func (cmd * cobra.Command , args []string ) {
@@ -71,6 +79,7 @@ func init() {
7179 runCmd .Flags ().BoolVar (& color , "color" , isTerm , "Whether to display colorized output" )
7280 runCmd .Flags ().BoolVar (& noColor , "no-color" , false , "Equivalent to --color=false" )
7381 runCmd .Flags ().MarkHidden ("no-color" )
82+ logLevel .AddFlag (runCmd )
7483 debug .AddFlag (runCmd )
7584 browser .AddFlag (runCmd )
7685}
@@ -124,6 +133,7 @@ func runApp(appRoot, wd string) {
124133 TraceFile : root .TraceFile ,
125134 Namespace : nonZeroPtr (nsName ),
126135 Browser : browserMode ,
136+ LogLevel : nonZeroPtr (logLevel .Value ),
127137 })
128138 if err != nil {
129139 fatal (err )
0 commit comments