MCPcopy Index your code
hub / github.com/jetify-com/devbox / doLogCommand

Function doLogCommand

internal/boxcli/log.go:25–47  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

23}
24
25func doLogCommand(cmd *cobra.Command, args []string) error {
26 if len(args) < 1 {
27 return usererr.New("expect an <event-name> arg for command: %s", cmd.CommandPath())
28 }
29
30 switch eventName := args[0]; eventName {
31 case "shell-ready":
32 if len(args) < 2 {
33 return usererr.New("expected a start-time argument for logging the shell-ready event")
34 }
35 telemetry.Event(telemetry.EventShellReady, telemetry.Metadata{
36 EventStart: telemetry.ParseShellStart(args[1]),
37 })
38 case "shell-interactive":
39 if len(args) < 2 {
40 return usererr.New("expected a start-time argument for logging the shell-interactive event")
41 }
42 telemetry.Event(telemetry.EventShellInteractive, telemetry.Metadata{
43 EventStart: telemetry.ParseShellStart(args[1]),
44 })
45 }
46 return usererr.New("unrecognized event-name %s for command: %s", args[0], cmd.CommandPath())
47}

Callers 1

logCmdFunction · 0.85

Calls 3

NewFunction · 0.92
EventFunction · 0.92
ParseShellStartFunction · 0.92

Tested by

no test coverage detected