Client new logger (#964)

This commit is contained in:
Dima 2020-10-26 17:38:01 +03:00 committed by GitHub
parent ca76c10659
commit 6ebba3242d
3 changed files with 20 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "fluence",
"version": "0.7.53",
"version": "0.7.54",
"description": "the browser js-libp2p client for the Fluence network",
"main": "./dist/fluence.js",
"typings": "./dist/fluence.d.ts",

File diff suppressed because one or more lines are too long

View File

@ -62,7 +62,24 @@ export async function instantiateStepper(pid: PeerId): Promise<Stepper> {
"host": { log_utf8_string: (level: any, target: any, offset: any, size: any) => {
try {
let str = getStringFromWasm0(wasm, offset, size)
log.debug(str)
switch (level) {
case 1:
log.error(str)
break;
case 2:
log.warn(str)
break;
case 3:
log.info(str)
break;
case 4:
log.debug(str)
break;
case 5:
log.trace(str)
break;
}
} finally {
}
}