Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README formatting #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 27 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
## gotrace
### tracing for go programs
# gotrace

gotrace annotates function calls in go source files with log statements on entry and exit.
## Tracing for go programs

usage: gotrace [flags] [path ...]
-exclude string
exclude any matching functions, takes precedence over filter
-exported
only annotate exported functions
-filter string
only annotate functions matching the regular expression (default ".")
-formatLength int
limit the formatted length of each argument to 'size' (default 1024)
-package
show package name prefix on function calls
-prefix string
log prefix
-returns
show function return
-timing
print function durations. Implies -returns
-w re-write files in place
**gotrace** annotates function calls in go source files with log statements on entry and exit.

#### Example
```
usage: gotrace [flags] [path ...]
-exclude string
exclude any matching functions, takes precedence over filter
-exported
only annotate exported functions
-filter string
only annotate functions matching the regular expression (default ".")
-formatLength int
limit the formatted length of each argument to 'size' (default 1024)
-package
show package name prefix on function calls
-prefix string
log prefix
-returns
show function return
-timing
print function durations. Implies -returns
-w re-write files in place
```

### Example

```sh
# gotrace operates directly on go source files.
# Insert gotrace logging statements into all *.go files in the current directory
# Make sure all files are saved in version control, as this rewrites them in-place!

$ gotrace -w -returns ./*.go
```