-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: custom log output #12
Comments
@osterman Hey! Thanks. I'm interested in this idea, but could you elaborate a bit more on your expectations? The nature of HCL is that we can't detect the order among different kinds of blocks. So we can't process
So perhaps I would make |
Hrmm... the way I was thinking about it is |
@osterman Thanks! That makes sense. I'm not sure if It's already used by the Do you have any other alternative that sounds better in terms of the above concerns? After a quick brain storming I came up with:
A different approach would be somehow enhancing the existing |
How about this... we extend the current logformat = "%Y-%M-%d %H:%m:%s [${job}] ${message}"
job "test" {
run "echo" {
message = "foo"
}
log {
prelude = "initializing project in ${var.moduledir}"
epilogue = "initialized project in ${var.moduledir}"
# collect is optional
collect {
condition = event.type == "exec"
format = "exec=${jsonencode(event.exec)}"
}
} Or... logformat = "%Y-%M-%d %H:%m:%s [${job}] ${message}"
job "test" {
run "echo" {
message = "foo"
}
# debug is the log level, could have info, warn, etc...
log "debug" {
message = "initializing project in ${var.moduledir}"
sequence = 0
}
log "collect" {
condition = event.type == "exec"
format = "exec=${jsonencode(event.exec)}"
}
} Or... logformat = "%Y-%M-%d %H:%m:%s [${job}] ${message}"
job "test" {
run "echo" {
message = "foo"
}
# debug is the log level, could have info, warn, etc...
prelude "debug" {
message = "initializing project in ${var.moduledir}"
}
...
} Then maybe with a |
Thanks! The concept of the log level seems necessary and useful. |
what
use-case
example output
The text was updated successfully, but these errors were encountered: