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

Added optional print_fcn argument to rfsmpp.gen_dbgcolor #7

Merged

Conversation

meyerj
Copy link
Contributor

@meyerj meyerj commented Feb 3, 2015

This allows to redirect the debug output to the Orocos RTT logger or any other custom logging function.
The dbgcolor(...) function has been split into dbgcolorize(...) that only returns the colorized string and dbgcolor(...) which prints the output of dbgcolorize.

Usage example:

"fsm.dbg=rfsmpp.gen_dbgcolor("rfsm-rtt-example",
                 { STATE_ENTER=true, STATE_EXIT=true},
                 false,
                 function(...) rtt.logl('Debug', ...) end)

The patch should be backwards compatible. Note that I am not a Lua expert, so there might be better/easier solutions.

CC: @smits

This allows to redirect the colorized debug output to the Orocos RTT logger or any other custom logging function.
The `dbgcolor(...)` function has been split into `dbgcolorize(...)` that only returns the colorized string and
`dbgcolor(...)` which prints the output of `dbgcolorize`.

Usage example:
```lua
"fsm.dbg=rfsmpp.gen_dbgcolor("rfsm-rtt-example",
                 { STATE_ENTER=true, STATE_EXIT=true},
                 false,
                 function(...) rtt.logl('Debug', ...) end)
```
@kmarkus kmarkus merged commit c45eeb6 into kmarkus:master Sep 16, 2020
@kmarkus
Copy link
Owner

kmarkus commented Sep 16, 2020

My apologies for the minor delay... looks good, merged, thanks!

@meyerj meyerj deleted the added-print-fcn-argument-to-gen_dbgcolor branch September 24, 2020 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants