firebase / firebase/firebase-tools

`functions.logger` output is ugly in the emulators

Open
#3,419 1 comment 4 reactions 0 assignees View on GitHub
emulator-suite polish
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [REQUIRED] Environment info

**firebase-tools:** 9.12.0

**Platform:** all

### [REQUIRED] Test case

```
const functions = require("firebase-functions");

exports.loggerTest = functions.https.onRequest((request, response) => {
functions.logger.info("functions.logger");
functions.logger.info("functions.logger with structure", { structuredData: true });
console.log("console.log");
console.warn("console.warn");

response.send("Hello from Firebase!");
});
```

### [REQUIRED] Steps to reproduce

Run the function above.

### [REQUIRED] Expected behavior

Clean and uncluttered logging output.

### [REQUIRED] Actual behavior

Even simple messages via `functions.logger`are presented as complex JSON objects. This is not the case for `console.log`

**Logging Emulator**
![Screen Shot 2021-05-27 at 3 37 58 PM](https://user-images.githubusercontent.com/8466666/119846066-ceb2c300-bed7-11eb-85f0-12d3ba651882.png)

**Console**
Screen Shot 2021-05-27 at 3 38 05 PM

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.