noop walletLogger if wallet isn't provided

This commit is contained in:
k00b 2024-11-12 09:22:51 -06:00
parent cb8cce77f0
commit d1c770dbbc
1 changed files with 10 additions and 0 deletions

View File

@ -675,6 +675,16 @@ const resolvers = {
export default injectResolvers(resolvers)
export const walletLogger = ({ wallet, models }) => {
// no-op logger if wallet is not provided
if (!wallet) {
return {
ok: () => {},
info: () => {},
error: () => {},
warn: () => {}
}
}
// server implementation of wallet logger interface on client
const log = (level) => async (message, context = {}) => {
try {