-
Notifications
You must be signed in to change notification settings - Fork 26
feat(logs): Use debug.js
library for logging [DXJ-327]
#285
Conversation
debug.js
library for logging [DXJ-327]
DXJ-118 FluenceJS debug logging improvements
These should be absolutely forbidden for the eternity:
I'd also recommend enabling timestamps in logs and having some log formatting like eg aqua has:
DXJ-71 Use 'debug' for logging in FluenceJS
Swap logLevel for debug for the following reasons:
Do not forget to update logging in marine-js Don't forget to mention that "verbose" should be turned on for logs to work in browser |
export const registerService: RegisterService = ({ peer, def, serviceId, service }) => { | ||
log.debug('registering aqua service %o', { def, serviceId, service }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a log that service was registered successfully? not sure
@@ -134,37 +136,41 @@ export class RelayConnection extends FluenceConnection { | |||
|
|||
async connect(onIncomingParticle: ParticleHandler) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to add log that connection succeeded?
item.particle.logTo('debug', 'sending particle:'); | ||
this.connection?.sendParticle(item.nextPeerIds, item.particle.toString()).then( | ||
() => { | ||
log.trace('id %s. sending particle into network', item.particle.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.trace('id %s. sending particle into network', item.particle.id); | |
log.trace('id %s. sending particle to relay', item.particle.id); |
@@ -226,7 +227,7 @@ export class EphemeralNetwork { | |||
} | |||
|
|||
private async _send(from: PeerIdB58, to: PeerIdB58[], particle: string) { | |||
log.info(`Sending particle from ${from}, to ${JSON.stringify(to)}`); | |||
log.trace(`Sending particle from %s, to %j`, from, to); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add particle id here?
const hello = await helloTest(); | ||
console.log('hello test finished, result: ', hello); | ||
|
||
// TODO: some wired error shit about SharedArrayBuffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a task for that? just so we don't forget
closes: DXJ-327, DXJ-118, DXJ-71