-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tracing feature for package gproc (#1923)
- Loading branch information
Showing
22 changed files
with
355 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/gogf/gf/v2/frame/g" | ||
"github.com/gogf/gf/v2/os/gcmd" | ||
"github.com/gogf/gf/v2/os/gctx" | ||
"github.com/gogf/gf/v2/os/gproc" | ||
) | ||
|
||
var ( | ||
Main = &gcmd.Command{ | ||
Name: "main", | ||
Brief: "main process", | ||
Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { | ||
g.Log().Debug(ctx, `this is main process`) | ||
return gproc.ShellRun(ctx, `go run sub/sub.go`) | ||
}, | ||
} | ||
) | ||
|
||
func main() { | ||
Main.Run(gctx.New()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/gogf/gf/v2/frame/g" | ||
"github.com/gogf/gf/v2/os/gcmd" | ||
"github.com/gogf/gf/v2/os/gctx" | ||
) | ||
|
||
var ( | ||
Sub = &gcmd.Command{ | ||
Name: "sub", | ||
Brief: "sub process", | ||
Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { | ||
g.Log().Debug(ctx, `this is sub process`) | ||
return nil | ||
}, | ||
} | ||
) | ||
|
||
func main() { | ||
Sub.Run(gctx.New()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/gogf/gf/v2/frame/g" | ||
"github.com/gogf/gf/v2/os/gctx" | ||
"github.com/gogf/gf/v2/os/gproc" | ||
) | ||
|
||
func main() { | ||
ctx := gctx.New() | ||
g.Log().Debug(ctx, `this is main process`) | ||
if err := gproc.ShellRun(ctx, `go run sub/sub.go`); err != nil { | ||
panic(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/gogf/gf/v2/frame/g" | ||
"github.com/gogf/gf/v2/os/gctx" | ||
) | ||
|
||
func main() { | ||
ctx := gctx.New() | ||
g.Log().Debug(ctx, `this is sub process`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.