Is there someway to disable all firebase logging to console?
In our testing suite, we rewrite process.stderr.write to only ignore firebase warnings like so:
Javascript
process.stderr.write = (function(write) {
return function() {
if (!arguments[0].includes("FIREBASE WARNING"))
write.apply(process.stderr, arguments);
};
}(process.stderr.write));
Typescript (including tslint fix)
process.stderr.write = (() => {
// tslint:disable-next-line:no-unbound-method
const write = process.stderr.write;
return function () {
if (!(arguments[0] as string).includes("FIREBASE WARNING")) {
return write.apply(process.stderr, arguments);
}
};
})();
There is no way to disable the security warnings as they are emitted asynchronously by the Firebase SDK. I worked around this by adding a message before the errors:
>>> An intentional security error should be printed after this line...
As Kato said, there doesn't appear to be an official way to disable it. That said, if you really want to, it takes 2 seconds to go into the source, Ctrl+F for "WARNING", and comment out this line:
"undefined"!==typeof console.warn?console.warn(b):console.log(b)