We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi @trentm,
I'm trying to add below test case because I've something similar in my application. But the serializer function is never called.
test('custom serializer on error and params', function (t) { var records = []; function customSerializer(message) { console.log({ message }); let _maskedMessage = { ...message }; let _isString = true; if (typeof message !== "string") { _maskedMessage = JSON.stringify(message); _isString = false; } _maskedMessage = _maskedMessage.replace(/"password":(["])(?:(?=(\\?))\2.)*?\1/gmi, "\"password\": \"*******\""); if (_isString === true) { return _maskedMessage; } const _parsed = JSON.parse(_maskedMessage); return _parsed; } var log = createLogger({ "msg": customSerializer, "_data": customSerializer, "_message": customSerializer, "realm": customSerializer, "params": customSerializer, "serviceAccount": customSerializer, "_msg": customSerializer }, records); const err = new Error("T"); log.info(err, {password: "test"}, "Testing serialization"); t.has(records[0].msg, "*****"); t.end(); });
Are the serializers not applied for internal keywords? If that is not the case, what am I missing here?
serializers
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi @trentm,
I'm trying to add below test case because I've something similar in my application. But the serializer function is never called.
Are the
serializers
not applied for internal keywords? If that is not the case, what am I missing here?The text was updated successfully, but these errors were encountered: