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

[Feature] Logging output assertion #249

Open
1 task done
ysugimoto opened this issue Jan 27, 2024 · 1 comment
Open
1 task done

[Feature] Logging output assertion #249

ysugimoto opened this issue Jan 27, 2024 · 1 comment
Assignees
Labels
feature request The issue could be reproduced

Comments

@ysugimoto
Copy link
Owner

Kind of proposals

You can turn on multiple checkboxes.

  • [] Parser
  • [] Linter
  • [] Simulator
  • Testing

Describe the feature

We need a new log message assertion function.
To assert what log message is outputted inside VCL runtime, need testing function which retrieves log statement output.

// @scope: RECV
// @suite: logging assertion
sub test_recv {
  testing.call_subroutine("vcl_recv");
  assert.match(testing.logged_message(), "^\[log]:\s.*");
}

Give us your considerations

We should consider about realtime loggings that will send to the S3, Datadog, etc.

@ysugimoto ysugimoto added the feature request The issue could be reproduced label Jan 27, 2024
@ysugimoto ysugimoto self-assigned this Jan 27, 2024
@richardmarshall
Copy link
Collaborator

Not sure if you've already began work on this but I got started on something similar to this a while back but got distracted and didn't finish it up for a PR.

https://github.com/richardmarshall/falco/commits/testing_getlog/

The primary motivation for what I was doing was to enable validating structured JSON log messages with a assert.is_json test function. If you're already working on this I can just rebase that work on what you've done. If not I'm happy to clean up the whole branch and submit that as a fix for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request The issue could be reproduced
Projects
None yet
Development

No branches or pull requests

2 participants