diff --git a/src/lib/waku_light_push/index.ts b/src/lib/waku_light_push/index.ts index 101bb514f0..a5a36bcce7 100644 --- a/src/lib/waku_light_push/index.ts +++ b/src/lib/waku_light_push/index.ts @@ -1,5 +1,6 @@ import type { PeerId } from "@libp2p/interface-peer-id"; import type { Peer } from "@libp2p/interface-peer-store"; +import debug from "debug"; import all from "it-all"; import * as lp from "it-length-prefixed"; import { pipe } from "it-pipe"; @@ -14,6 +15,8 @@ import { WakuMessage } from "../waku_message"; import { PushRPC } from "./push_rpc"; +const log = debug("waku:light-push"); + export const LightPushCodec = "/vac/waku/lightpush/2.0.0-beta1"; export { PushResponse }; @@ -86,16 +89,16 @@ export class WakuLightPush { const response = PushRPC.decode(bytes).response; if (!response) { - console.log("No response in PushRPC"); + log("No response in PushRPC"); return null; } return response; } catch (err) { - console.log("Failed to decode push reply", err); + log("Failed to decode push reply", err); } } catch (err) { - console.log("Failed to send waku light push request", err); + log("Failed to send waku light push request", err); } return null; } diff --git a/src/test_utils/nwaku.ts b/src/test_utils/nwaku.ts index 4cbffc3019..7d8404f322 100644 --- a/src/test_utils/nwaku.ts +++ b/src/test_utils/nwaku.ts @@ -173,7 +173,7 @@ export class Nwaku { }); this.process.on("error", (err) => { - console.log( + dbg( `nwaku ${ this.process ? this.process.pid : this.pid } process encountered an error: ${err} at ${new Date().toLocaleTimeString()}`