Skip to content

emulator logs missing functionality of online console logs #1859

Closed

Description

@ultraGentle

Hello, really enjoying firebase, but finding debugging a little bit painful. To wit,

It would be very helpful to at least have symbols like LOG:, WARNING:

[REQUIRED] Environment info

firebase-tools: 7.9.0
Platform: macOS 10.13.6

[REQUIRED] Test case

In index.js, create a simple function with console.log('log'), console.error('error')

[REQUIRED] Steps to reproduce

(1) Deploy function; check online logs.
(2) Serve/emulate function locally; check terminal logs.

[REQUIRED] Expected behavior

Local logs should display clear differentiation between log types.

[REQUIRED] Actual behavior

log and error are not differentiated, making it difficult to visually scan what's going on.

For some context, I'm a beginner when it comes to back-end debugging, but I'd like to believe that Firebase is at least partially targeted at users like me, who have a front-end background, and are looking for a friendly way to add serverless functionality.

So, I'm used to looking at logs in the browser console, where log, warn, and error are presented visually differently, and can be filtered.

This is an accessibility issue as well, since not everyone can easily visually scan a giant block of undifferentiated text (see #1839) -- the symbols and colors of browser devtools are a boon in that regard.

So, to summarize, it would be extremely helpful to have better logging tools available locally,

  • symbols or text to differentiate log level
  • separation of explicit user logging from auto-generated logs
  • and at the bare minimum, to replicate the logging of the online console.

I hope this is helpful feedback. If I'm ignorant to a better way of debugging firebase functions, I would welcome suggestion. And again, kudos on these tools.

PS: Just a final thought: perhaps when running firebase serve, the logs from index.js could be sent to the browser console? I have no idea if that's possible, but if it were, it would certainly make life easier!

Activity

  1. changed the title [-]emulator logs missing functionality of online console function logs[/-] [+]emulator logs missing functionality of online console logs[/+] on Dec 11, 2019
  2. ultraGentle commented on Dec 13, 2019

    @ultraGentle
    Author

    Just to update this, when the firebase serve command is run, the output actually does have useful iconography:

    i  emulators: Starting emulators: functions, firestore, database, pubsub
    ⚠  Your requested "node" version "8" doesn't match your global version "12"
    ✔  functions: Emulator started at http://localhost:5001
    i  firestore: Serving ALL traffic (including WebChannel) on http://localhost:8080
    ⚠  firestore: Support for WebChannel on a separate port (8081) is DEPRECATED and will go away soon. Please use port above instead.
    i  firestore: Emulator logging to firestore-debug.log
    ✔  firestore: Emulator started at http://localhost:8080
    

    So, symbols like that tied to console.log, warn, error, info would help make local logging easier to read!

  3. samtstern commented on Dec 16, 2019

    @samtstern
    Contributor

    @ultraGentle thanks for the feature request!

  4. removed their assignment
    on Dec 16, 2019
  5. ultraGentle commented on Dec 17, 2019

    @ultraGentle
    Author

    Sorry, just realized this is a duplicate of #1800 ! I'll do any additional communicating there.

  6. christophe-g commented on Dec 17, 2019

    @christophe-g

    ; ) Looks like a useful addition then !

  7. samtstern commented on Dec 18, 2019

    @samtstern
    Contributor

    I updated the title of #1800 so we can close this one and continue discussing there, as @ultraGentle suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions