refactor: remove `console.log` usage

This commit is contained in:
fryorcraken.eth 2022-09-05 21:27:22 +10:00
parent 023e175267
commit c5e1f50cc8
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,6 @@
import type { PeerId } from "@libp2p/interface-peer-id"; import type { PeerId } from "@libp2p/interface-peer-id";
import type { Peer } from "@libp2p/interface-peer-store"; import type { Peer } from "@libp2p/interface-peer-store";
import debug from "debug";
import all from "it-all"; import all from "it-all";
import * as lp from "it-length-prefixed"; import * as lp from "it-length-prefixed";
import { pipe } from "it-pipe"; import { pipe } from "it-pipe";
@ -14,6 +15,8 @@ import { WakuMessage } from "../waku_message";
import { PushRPC } from "./push_rpc"; import { PushRPC } from "./push_rpc";
const log = debug("waku:light-push");
export const LightPushCodec = "/vac/waku/lightpush/2.0.0-beta1"; export const LightPushCodec = "/vac/waku/lightpush/2.0.0-beta1";
export { PushResponse }; export { PushResponse };
@ -86,16 +89,16 @@ export class WakuLightPush {
const response = PushRPC.decode(bytes).response; const response = PushRPC.decode(bytes).response;
if (!response) { if (!response) {
console.log("No response in PushRPC"); log("No response in PushRPC");
return null; return null;
} }
return response; return response;
} catch (err) { } catch (err) {
console.log("Failed to decode push reply", err); log("Failed to decode push reply", err);
} }
} catch (err) { } catch (err) {
console.log("Failed to send waku light push request", err); log("Failed to send waku light push request", err);
} }
return null; return null;
} }

View File

@ -173,7 +173,7 @@ export class Nwaku {
}); });
this.process.on("error", (err) => { this.process.on("error", (err) => {
console.log( dbg(
`nwaku ${ `nwaku ${
this.process ? this.process.pid : this.pid this.process ? this.process.pid : this.pid
} process encountered an error: ${err} at ${new Date().toLocaleTimeString()}` } process encountered an error: ${err} at ${new Date().toLocaleTimeString()}`