mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-03-15 07:20:49 +00:00
fix loggning once more 2
This commit is contained in:
parent
3610ebabc7
commit
658a41b418
@ -609,9 +609,9 @@ async function runAvmWorker(
|
||||
toLog.data = dataToString(toLog.data);
|
||||
|
||||
if (isInterpretationSuccessful(interpreterResult)) {
|
||||
log.debug('Interpreter result: ', toLog);
|
||||
log.debug('Interpreter result: ', w(toLog));
|
||||
} else {
|
||||
log.error('Interpreter failed: ', toLog);
|
||||
log.error('Interpreter failed: ', w(toLog));
|
||||
}
|
||||
return interpreterResult;
|
||||
}
|
||||
|
@ -153,7 +153,12 @@ export const checkConnection = async (peer: FluencePeer, ttl?: number): Promise<
|
||||
};
|
||||
|
||||
export function dataToString(data: Uint8Array) {
|
||||
return new TextDecoder().decode(Buffer.from(data));
|
||||
const text = new TextDecoder().decode(Buffer.from(data));
|
||||
try {
|
||||
return JSON.stringify(JSON.parse(text), null, 4);
|
||||
} catch {
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
export function w(obj) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user