Skip to content

Commit

Permalink
Merge pull request #36 from StauroDEV/more-emoji-ids
Browse files Browse the repository at this point in the history
fix: use logger more
  • Loading branch information
talentlessguy authored May 28, 2024
2 parents 6db81f0 + 059e92d commit 8526188
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions site/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
## Features

- **Multi-Provider Deployment**: Deploy your web app simultaneously on multiple IPFS providers, including [web3.storage](https://web3.storage), [Gateway3](https://gw3.app) and [Filebase](https://filebase.com).
- **ENS and DNSLink Integration**: Seamlessly integrate with [ENS](https://ens.domains) and [DNSLink](https://dnslink.dev) to update your Content-Hash, making it easier for users to access your web app via ENS gateways.
- **Safe Integration**: Add an extra layer of security and decentralization with [Safe](https://safe.global) multi-sig.
- **ENS and DNSLink Integration**: Seamlessly integrate with [ENS](https://ens.domains) and [DNSLink](https://dnslink.dev) to update your decentralized website.
- **Safe Integration**: Add an extra layer of security and decentralization with a [Safe](https://safe.global) multi-sig.

## Installation

Expand Down
10 changes: 7 additions & 3 deletions src/actions/ping.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as colors from 'colorette'
import { isTTY } from '../constants'
import { logger } from '../utils/logger'

let retryCount = 0

Expand All @@ -16,7 +17,10 @@ export const pingAction = async (

retryCount++
const url = `https://${cid}.ipfs.${endpoint}`
console.log(`${isTTY ? colors.bold(`[${retryCount}]`) : `[${retryCount}]`}: Requesting content at ${url}`)
console.log(`${isTTY
? `${colors.bold(`[${retryCount}]`)}: Requesting content at ${url}`
: `[${retryCount}]`}: Requesting content at ${url}`,
)
try {
const response = await fetch(url, { signal: AbortSignal.timeout(timeout), redirect: 'follow' })
if (response.status === 504) {
Expand All @@ -32,7 +36,7 @@ export const pingAction = async (
else {
return console.log(`Gateway status: ${
response.status >= 200 && response.status < 400
? (isTTY ? colors.bold(colors.green(`Online ${response.status}`)) : `Online ${response.status}`)
? logger.info((isTTY ? colors.bold(colors.green(`Online ${response.status}`)) : `Online ${response.status}`))
: response.status
}`)
}
Expand All @@ -47,7 +51,7 @@ export const pingAction = async (
return console.error(gwOfflineMessage)
}
}
console.error('Error fetching endpoint:', (error as Error).message)
logger.error('Error fetching endpoint:', (error as Error).message)
throw error
}
}

0 comments on commit 8526188

Please sign in to comment.