[英]What logger to use for Firebase Functions?
Firebase recommends in their documentation to use their cloud functions logger SDK. Firebase 在他们的文档中建议使用他们的云功能记录器 SDK。 Does anyone recommend to use another logger such as Winston instead?有没有人建议使用其他记录器,例如 Winston?
const functions = require("firebase-functions");
functions.logger.log("Hello from info");
I personally prefer to use directly Cloud Logging library as it gives more customization if needed.我个人更喜欢直接使用Cloud Logging 库,因为它可以在需要时提供更多自定义。 ( Firebase logging relies on it) ( Firebase 日志记录依赖它)
If you prefer Winston you have an implementation for Google Cloud.如果您更喜欢 Winston,您可以使用 Google Cloud 实现。 https://cloud.google.com/logging/docs/samples/logging-winston-quickstart https://cloud.google.com/logging/docs/samples/logging-winston-quickstart
I would choose one or another depending on "portability".我会根据“便携性”选择一个或另一个。 If you plan to stick with Firebase/Google Cloud I will go for Cloud Logging as it will work also with other Google services (ex. Cloud Run).如果您打算坚持使用 Firebase/Google Cloud,我将为 Cloud Logging 使用 go,因为它也可以与其他 Google 服务(例如 Cloud Run)一起使用。 If not, Winston is almost and standard.如果不是,温斯顿几乎是标准的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.