You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let SOME_VAR = "123"
log {
name => "log-one"
message => "one - ${SOME_VAR}"
require => "log-two"
}
let SOME_VAR = "abc"
let COMMAND_RESULT = `find /tmp`
log {
name => "log-two"
message => "two - ${SOME_VAR}"
unless => set("${COMMAND_RESULT}")
}
The above will output
2022/01/11 13:21:35 [USER] two - 123
2022/01/11 13:21:35 [USER] one - 123
There are two issues here.
People may think that two - abc should be logged by looking at the definition. It's understandable why it doesn't but it's non-obvious. This may be something that's just accepted and documented as a known limitation.
The bigger issue is where the execution is conditional. With the removal of backtick execution from conditionals, log-two in the example ran because COMMAND_RESULT is empty at the point of execution, only after is find /tmp run and /tmp is unlikely to be empty. Now this came from the move to the AST based approach but I think backtick execution would need to make a come back.
The text was updated successfully, but these errors were encountered:
The above will output
There are two issues here.
People may think that
two - abc
should be logged by looking at the definition. It's understandable why it doesn't but it's non-obvious. This may be something that's just accepted and documented as a known limitation.The bigger issue is where the execution is conditional. With the removal of backtick execution from conditionals,
log-two
in the example ran becauseCOMMAND_RESULT
is empty at the point of execution, only after isfind /tmp
run and/tmp
is unlikely to be empty. Now this came from the move to the AST based approach but I think backtick execution would need to make a come back.The text was updated successfully, but these errors were encountered: