Skip to content

Debugging custom promise types #4526

Answered by olehermanse
larsewi asked this question in Q&A
Discussion options

You must be logged in to vote

How to only see log messages from module?

Sometimes I'm only interested in log messages from the custom promise module.

Currently not possible, built-in, but you can make a workaround:

$ /var/cfengine/bin/cf-agent -KId test.cf | grep -A1 "Received line from module\: 'log_" | grep --invert-match "Received line from module"
    info: Cloning 'https://github.com/cfengine/masterfiles' -> '/opt/cfengine/masterfiles'...
    info: Successfully cloned 'https://github.com/cfengine/masterfiles' -> '/opt/cfengine/masterfiles'

Assuming the module doesn't use JSON protocol for logging, and that the log messages appear directly after the line received messages.

Details

We don't have separate levels …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@larsewi
Comment options

larsewi Mar 2, 2021
Maintainer Author

Answer selected by larsewi
Comment options

You must be logged in to vote
1 reply
@larsewi
Comment options

larsewi Mar 2, 2021
Maintainer Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants