简体   繁体   中英

how to view readable console logs from firebase simulator?

I'm building some nodeJS cloud functions and running locally with the firebase simulator. The logs come out as huge ugly blobs. double escaped, term colors as unicode, line wrapping broken, just horrible...

Is there a way to make this output more readable?

When I run same code as unit tests without the google stack, it's clean, so it's def something to do with the firebase simulator pipeline crunching everything down.

I have some logs that use the functions.logger, and I guess thats beyond salvation as it's designed for cloudlogger. RIP.

But I'm also using some simple debug('...') which I was hoping to get human readable - even nicely formatted and colorized. - output from.

It looks a bit better in the firebase tools web browser but i'd prefer to just have console logs.

My cmd to run the FB app doesn't pipe the output through anything:

firebase emulators:start --only functions

firebase 糟糕的 DX

Seems like this feature is still in Alpha state. There is a feature request raised for log level formatting in functions emulator and shell in github. You can also add your concern over there.

Currently, You can use firebase emulators:start --inspect-functions to view Firebase emulator logs in browser devtools, as discussed here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM