MCPcopy Create free account
hub / github.com/google/gapid / ExampleVerbose

Function ExampleVerbose

core/os/shell/command_example_test.go:48–57  ·  view source on GitHub ↗

This example shows how to run a command, with it's standard out and error being logged.

()

Source from the content-addressed store, hash-verified

46
47// This example shows how to run a command, with it's standard out and error being logged.
48func ExampleVerbose() {
49 ctx := newCtx()
50 err := shell.Command("echo", "Hello", "from the shell").Verbose().Run(ctx)
51 if err != nil {
52 log.F(ctx, true, "Unable to say hello: %v", err)
53 }
54 // Output:
55 //I: [Example] Exec: echo Hello "from the shell"
56 //I: [Example] <echo> Hello from the shell
57}
58
59// This example shows how to run a command and capture it's output.
60func ExampleCapture() {

Callers

nothing calls this directly

Calls 5

VerboseMethod · 0.80
FMethod · 0.80
newCtxFunction · 0.70
RunMethod · 0.65
CommandMethod · 0.65

Tested by

no test coverage detected