erquhart
erquhart10mo ago

Local logging on by default sometimes

Does npx convex dev use any sort of inference to turn on logging by chance? It seems to print logs without the --tail-logs flag depending on how it's run. Here are three npm scripts I use:
"start": "concurrently --raw \"npm:expo-start\" \"npm:convex-dev\"",
"expo-start": "doppler run -p expo -c dev --mount .env -- expo start -p 8088",
"convex-dev": "doppler run -p convex -c dev -- npx convex dev",
"start": "concurrently --raw \"npm:expo-start\" \"npm:convex-dev\"",
"expo-start": "doppler run -p expo -c dev --mount .env -- expo start -p 8088",
"convex-dev": "doppler run -p convex -c dev -- npx convex dev",
The first script just runs the other two concurrently. - If I do npm start, I get logs, even though there's no --tail-logs flag - If I do npm run convex-dev, I get no logs, as expected I'd like to run npm start with no convex logs and then log for the backend in a separate cli, but I can't get npm start to not log for convex.
8 Replies
Michal Srb
Michal Srb10mo ago
This would be super surprising. Can you share a screenshot/copy of the "logs" you're seeing when running npm start?
erquhart
erquhartOP10mo ago
On further investigation, logs are printing from Convex with just npm run expo-start:
No description
erquhart
erquhartOP10mo ago
I'm obviously missing something silly here, but that command is just running expo local dev, how is this possible? Does Convex propagate logs through to the client useQuery()/useMutation() under any circumstance?
RJ
RJ10mo ago
Could Expo be propagating frontend (console) logs to the terminal?
Michal Srb
Michal Srb10mo ago
I think RJ is correct, the format is the one the JS clients use, not the CLI Our clients don't have an option to turn the logs off, but you might be able to tell Expo to not forward them
erquhart
erquhartOP10mo ago
So logs in convex functions do propagate through to the frontend automatically? Eg., if this was in the browser, Convex logs would print to the browser console? If so is there a way to have backend-only logs oh I bet this is only dev isn't it
RJ
RJ10mo ago
Yeah only dev I believe
erquhart
erquhartOP10mo ago
My feedback would be that controlling logs in local dev would be helpful, and outputting server logs to the browser should be optional.

Did you find this page helpful?