0

I am currently working on a Firebase function. As I am still in the development stage, I have a number of logs in my code to see what's going on.

async function getAddressByIdAsync(address) {

    let addr = addressesRef.child(address);
    console.log(addr);

    return admin.database().ref('Addresses/' + address);
}

The only way I have found to be able to see these logs in real time is though the Firebase console, which is very slow and generally a bad UI experience IMO.

I'm looking for a command line solution that will let me see in real time the logs coming from the Firebase cloud function.

I have tried this command

firebase functions:log

Which appears to return the last twenty or so log entries into my Firebase Functions.

I know Google Cloud has a tail option on the end of that CLI but it doesn't work here.

firebase functions:log tail

Error: Too many arguments. Run firebase help functions:log for usage instructions

Is there a way to get a live running output of the logs from firebase cloud functions?

MFerguson
  • 1,739
  • 9
  • 17
  • 30
Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449

1 Answers1

0

You can try the local emulator, that way you can first run your functions locally (and log in your terminal), before deploying.

https://firebase.google.com/docs/functions/local-emulator

robinalaerts
  • 532
  • 4
  • 5