Browse Source

En cours de développement

master
mls-361 9 months ago
parent
commit
2d0585a889
  1. 2
      go.mod
  2. 4
      go.sum
  3. 33
      internal/cli/logger.go

2
go.mod

@ -6,7 +6,7 @@ require (
forge.chapril.org/armen/jw v0.0.0-20210818171942-8aa1b1ff4ef1
forge.chapril.org/armen/memory v0.0.0-20210818172030-e30bcad1d6b2
forge.chapril.org/armen/model v0.0.0-20210818172052-84cab7489598
forge.chapril.org/armen/requestor v0.0.0-20210818172815-857179e1f9c3
forge.chapril.org/armen/requestor v0.0.0-20210818200826-074120d5c320
forge.chapril.org/armen/runner v0.0.0-20210818172841-6f4a75690ae2
forge.chapril.org/armen/workers v0.0.0-20210818172904-86e683e8a122
forge.chapril.org/mls-361/application v0.0.0-20210805205753-c663b93b7e1a

4
go.sum

@ -6,8 +6,8 @@ forge.chapril.org/armen/memory v0.0.0-20210818172030-e30bcad1d6b2 h1:92iEK2OQIKr
forge.chapril.org/armen/memory v0.0.0-20210818172030-e30bcad1d6b2/go.mod h1:h31f46tV9ntcbFr4tqFOrNBLEh6Iqrjh855bmbgor8o=
forge.chapril.org/armen/model v0.0.0-20210818172052-84cab7489598 h1:VkcsXpDjPucYsXNl8og/djulyUIepEJBqg20bWv1YLw=
forge.chapril.org/armen/model v0.0.0-20210818172052-84cab7489598/go.mod h1:rVoJAcySb4Z4hsP3O+s5j9KtAB0TZfp/XuvHqMZR1jQ=
forge.chapril.org/armen/requestor v0.0.0-20210818172815-857179e1f9c3 h1:6FXXe5Ldb54bvV9DBp3yGPsxMY4uRRVLg9it+kUspMY=
forge.chapril.org/armen/requestor v0.0.0-20210818172815-857179e1f9c3/go.mod h1:yVBF/fCGC5WD4WwGjrftP9UlD3jNavXgc3PWMVnpxc8=
forge.chapril.org/armen/requestor v0.0.0-20210818200826-074120d5c320 h1:DoMUCCCiXM/Srr1lSLdvFUzojIvGrnJ9wqLSukBSFVU=
forge.chapril.org/armen/requestor v0.0.0-20210818200826-074120d5c320/go.mod h1:yVBF/fCGC5WD4WwGjrftP9UlD3jNavXgc3PWMVnpxc8=
forge.chapril.org/armen/runner v0.0.0-20210818172841-6f4a75690ae2 h1:Qk2fN735wHeNeTDaUWTYMkht2hN9kMHskcmTD46cT6I=
forge.chapril.org/armen/runner v0.0.0-20210818172841-6f4a75690ae2/go.mod h1:jEz24GFudi2azgIoV2wzu7zoo4vmfK9MSNQu+BgfK5g=
forge.chapril.org/armen/workers v0.0.0-20210818172904-86e683e8a122 h1:fgmlhnNJhTRM6372QEhplJ9jWuQb7Z279OokcSuHLTI=

33
internal/cli/logger.go

@ -6,9 +6,7 @@
package cli
import (
"forge.chapril.org/armen/armen/internal/components"
)
import "forge.chapril.org/armen/armen/internal/components"
func adminListLogger(ccs *components.Components) error {
requestor, err := newRequestor(ccs)
@ -24,6 +22,32 @@ func adminListLogger(ccs *components.Components) error {
return displayResult(all)
}
func adminSetLoggerLevel(args []string, ccs *components.Components) error {
if len(args) < 2 {
help()
return _errArgs
}
fs := newFlagSet(ccs)
var id string
var level string
fs.StringVar(&id, "id", "", "")
fs.StringVar(&level, "level", "", "")
if err := fs.Parse(args); err != nil {
return err
}
requestor, err := newRequestor(ccs)
if err != nil {
return err
}
return requestor.AdminSetLoggerLevel(id, level)
}
func logger(args []string, ccs *components.Components) error {
if len(args) < 1 {
help()
@ -31,12 +55,13 @@ func logger(args []string, ccs *components.Components) error {
}
arg := args[0]
//args = args[1:]
args = args[1:]
switch arg {
case "list":
return adminListLogger(ccs)
case "setlevel":
return adminSetLoggerLevel(args, ccs)
default:
help()
}

Loading…
Cancel
Save