-
Notifications
You must be signed in to change notification settings - Fork 198
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
cloud Function logging isn't working outside of the test scope anymore #3754
Comments
I can imagine how one might want to aggregate all of the logs from different functions that were "spawned" from a test... but I'm not sure it's clear what are the underlying rules for what logs are shown. For example: bring cloud;
bring util;
let processor = new cloud.Function(inflight (m: str) => {
log("processing: ${m}");
counter.inc();
});
let queue = new cloud.Queue();
queue.setConsumer(inflight (m: str) => {
processor.invoke(m);
});
let pusher = new cloud.Function(inflight (m: str) => {
log("pushing: ${m}");
queue.push(m);
});
let schedule = new cloud.Schedule(rate: 5s);
schedule.onTick(inflight () => {
pusher.invoke("bloop");
});
test "message is processed" {
pusher.invoke("floop");
util.sleep(10s);
assert(counter.peek() > 0);
log("success!");
}; Here I have a made-up app with a test at the end. The test pushes a message to a queue, and checks that a counter was incremented. There are also some ongoing events that will be happening unrelated to test (for example, a) "success!" More logs is usually better, but I could also imagine it being confusing to see unrelated logs mixed in with your test logs. It's sort of like if you create a child process in your computer, you may have to decide whether to inherit its STDIN/STDOUT or not. (except in the cloud, not all processes have parents? 🤔) @tsuf239 I'm curious if you have any thoughts |
I believe that the cloud targets should behave like the sim
What we can do in the future, when people start to have too many logs, is to specify the resource name:
Ordered by the timestamp, |
Hi, This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. |
Hi, This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. |
I tried this:
run
examples/tests/sdk_tests/function/logging.w
This happened:
logged:
only logs in the test scope
I expected this:
should log:
logs in any scope
Is there a workaround?
No response
Component
SDK
Wing Version
No response
Node.js Version
No response
Platform(s)
No response
Anything else?
No response
Community Notes
The text was updated successfully, but these errors were encountered: