firebase / firebase/firebase-functions

logger.error prints the stacktrace of line where it was invoked

Open
#1,681 3 comments 0 reactions 1 assignee Claimed by @CorieW View on GitHub
enhancement needs-attention
Dominant language
TypeScript
Stars
1.1k
Forks
232
Avg merge
20h 46m
Merged PRs (30d)
15

Description

### Related issues

Somewhat related to:
- https://github.com/firebase/firebase-functions/issues/1580
- https://github.com/firebase/firebase-functions/issues/1625

### [REQUIRED] Version info

**node:** 20

**firebase-functions:** 6.2.0

**firebase-tools:** 13.30.0

**firebase-admin:** 12.6.0

### [REQUIRED] Test case

```ts
import { logger } from "firebase-functions/v2";
import { onCall } from "firebase-functions/v2/https";

export const functionName = onCall({region: ["europe-west1"]}, async (req) => {
logger.error("User is not allowed to upload data for this userId", [ "234", "123" ]);
})
```

### [REQUIRED] Steps to reproduce

### [REQUIRED] Expected behavior

Error stacktrace should not be printed in plain text if not provided

### [REQUIRED] Actual behavior

Code sample above results with following outcome in GCP Logging:

![Image](https://github.com/user-attachments/assets/3ac297f7-ba14-4c52-a093-f38304537f3d)

### Were you able to successfully deploy your functions?

Yes

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.