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

Question: logging to file using interpreter monitor and logger #190

Open
crichardson332 opened this issue Nov 19, 2019 · 3 comments
Open

Comments

@crichardson332
Copy link

I'm trying to figure out how to log state transitions to a file, preferably using fstream. I see that there are logging classes that can log to streams, but I don't know exactly how to implement that. I'm able to get a logger that prints to std::cout, but I need to pipe it to a file instead. Is there an example somewhere on how to do this?

@sradomski
Copy link
Member

You are supposed to pass a Logger via the ActionLanguage to the interpreter.

@crichardson332
Copy link
Author

Is there an example or code snippet somewhere I can reference? I'm not clear on the API.

@crichardson332
Copy link
Author

What I want to do is something like this
uscxml::Logger mylogger = std::make_shared(new uscxml::StdOutLogger)
except I will replace StdOutLogger with my own custom implementation of a logger. But I'm getting the following error:

In file included from /usr/local/include/uscxml/interpreter/StdOutLogger.h:23:0,
                 from ../test/test_uscxml.cpp:41:
/usr/local/include/uscxml/interpreter/LoggingImpl.h:23:10: fatal error: uscxml/config.h: No such file or directory
 #include "uscxml/config.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.

This happens when my code has #include "uscxml/interpreter/StdOutLogger.h".

It looks like config.h exists in my build tree but not the install tree. Is there a build flag I'm missing?

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

No branches or pull requests

2 participants