Skip to content

functions.logger output is ugly in the emulators #3419

@samtstern

Description

@samtstern

[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.loggerare 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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions