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

Child execution debug printing tracing/hooks #163

Open
andrewchambers opened this issue May 31, 2019 · 0 comments
Open

Child execution debug printing tracing/hooks #163

andrewchambers opened this issue May 31, 2019 · 0 comments
Labels
enhancement New feature or request maybe

Comments

@andrewchambers
Copy link
Owner

andrewchambers commented May 31, 2019

I recently wanted to print out all the commands a script was executing (A C build script) - It was very hard to do so, In bash you do something like:

verbose () {
  echo "$@"
  "$@"
}

verbose cc foo.c ...

In janet I am not sure the right approach, but perhaps a dynamic variable that can be set to control a debug callback then users can define a macro like 'with-verbose'

(with-verbose (do (sh/$ cc ...) (sh/$ cc ...) (sh/$ cc ...)))

An alternative is to integrate with the janet vm trace functions by providing a clear trace point.

@andrewchambers andrewchambers added enhancement New feature or request maybe labels May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maybe
Projects
None yet
Development

No branches or pull requests

1 participant