Skip to content

Commit

Permalink
fix:fix debug
Browse files Browse the repository at this point in the history
  • Loading branch information
nuzulul committed Jun 14, 2024
1 parent 7b714aa commit 570f5a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ const prefix = config.CONFIG_PREFIX

export const mkErr = msg => new Error(`${prefix}: ${msg}`)

export function mkDebug(error){
return
}

export {PBPeer}

export function uint8ArrayToString(uint8Array){
Expand Down
11 changes: 6 additions & 5 deletions src/webpeerjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
Key,
msgIdFnStrictNoSign,
metrics,
getDigest
getDigest,
mkDebug
} from './utils'
import { createDelegatedRoutingV1HttpApiClient } from '@helia/delegated-routing-v1-http-api-client'
import { createLibp2p } from 'libp2p'
Expand Down Expand Up @@ -317,7 +318,7 @@ class webpeerjs{

}catch(err){
//console.log('from '+event.detail.from.toString())
console.debug(err)
mkDebug(err)
}
}else{
const json = JSON.parse(topic)
Expand Down Expand Up @@ -1090,7 +1091,7 @@ class webpeerjs{
return // if we succeed dialing the peer, no need to try another address
} catch (error) {
//console.log(`failed to dial webtransport multiaddr: %o`, addr.toString())
console.debug(error)
mkDebug(error)
}
}
}
Expand All @@ -1112,7 +1113,7 @@ class webpeerjs{
return // if we succeed dialing the peer, no need to try another address
} catch (error) {
//console.log(`failed to dial websocket multiaddr: %o`, addr)
console.debug(error)
mkDebug(error)
}
}
}
Expand All @@ -1122,7 +1123,7 @@ class webpeerjs{
static async createWebpeer(){

// all libp2p debug logs
localStorage.setItem('debug', 'libp2p:*')
//localStorage.setItem('debug', 'libp2p:*')

const dbstore = new IDBDatastore(config.CONFIG_DBSTORE_PATH)
await dbstore.open()
Expand Down
2 changes: 1 addition & 1 deletion test/project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"start": "npm run dev"
"start": "npm run dev"
},
"devDependencies": {
"vite": "^5.2.0"
Expand Down

0 comments on commit 570f5a1

Please sign in to comment.