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

Create flags to enable logs when call methods with fibers is in use. #461

Merged
merged 5 commits into from
Aug 9, 2022

Conversation

denihs
Copy link
Collaborator

@denihs denihs commented Aug 2, 2022

To enable logs using environment variable with params:

ENABLE_LOG_USE_FIBERS=1 to log calls with fibers.
ENABLE_LOG_USE_FIBERS=2 to log calls with fibers and print stack trace.

Usages example:

#!/usr/bin/env bash
echo ">>>>>> NO Log"
node log-fibers-test.js && echo ok
ENABLE_LOG_USE_FIBERS=0 node log-fibers-test.js && echo ok
echo ">>>>>> Log level 1"
ENABLE_LOG_USE_FIBERS=1 node log-fibers-test.js
echo ">>>>>> Log level 2 no filters"
ENABLE_LOG_USE_FIBERS=2 node log-fibers-test.js
echo ">>>>>> Log level 2 with filters matches"
ENABLE_LOG_USE_FIBERS=2 LOG_USE_FIBERS_INCLUDE_IN_PATH=meteor-fibers/node-fibers node log-fibers-test.js
echo ">>>>>> Log level 2 with filters no matches"
ENABLE_LOG_USE_FIBERS=2 LOG_USE_FIBERS_INCLUDE_IN_PATH=meteor-fibers/node2-fibers node log-fibers-test.js

To save all output messages in a file using shell redirect

ENABLE_LOG_USE_FIBERS=2 meteor &> fibers-stack.log

@denihs denihs merged commit 4c9e83e into laverdet:master Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants