Skip to content

Commit ffb0cb1

Browse files
committed
chore(sentinel2): changed logging format
Signed-off-by: Kaan Caglan <[email protected]>
1 parent 747d1f1 commit ffb0cb1

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

sentinel2/src/sentinel2.ts

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Effect, Schedule, Data, Context, Schema, Arbitrary, FastCheck, LogLevel } from "effect"
1+
import { Effect, Schedule, Data, Context, Schema, Arbitrary, FastCheck } from "effect"
22
import { http } from "viem"
33
import { privateKeyToAccount } from "viem/accounts"
44
import { sepolia } from "viem/chains"
@@ -14,9 +14,9 @@ import { hideBin } from "yargs/helpers"
1414
import fs from "node:fs"
1515
import type { Address } from "viem"
1616
import { request, gql } from "graphql-request"
17-
1817
type Hex = `0x${string}`
1918

19+
2020
// Chain pair configuration
2121
interface ChainPair {
2222
sourceChain: string
@@ -526,21 +526,13 @@ export const checkPackets = (
526526
// reportedSendTxHashes.add(sendTxHash)
527527
}
528528
} else {
529-
yield* Effect.log({
530-
level: LogLevel.Error,
531-
span: "checkPackets",
532-
message: `[TRANSFER_ERROR] > ${timeframeMs}ms since send`,
533-
annotations: {
534-
sendTxHash: `${sendTxHash}`,
535-
chain_pair: `${sourceChain}->${destinationChain}`,
536-
explorerUrl: `https://btc.union.build/explorer/transfers/${sort_order_tx}`,
537-
issueType: "RECV_MISSNG"
538-
}
539-
540-
})
541-
// yield* Effect.log(
542-
// `[TRANSFER_ERROR: RECV MISSING] >${timeframeMs}ms since send. sendTxHash=${sendTxHash}, chain_pair${sourceChain}->${destinationChain}, url: https://btc.union.build/explorer/transfers/${sort_order_tx}`
543-
// )
529+
yield* Effect.annotateLogs({
530+
issueType: "RECV_MISSING",
531+
sendTxHash,
532+
chain_pair: `${sourceChain}->${destinationChain}`,
533+
explorerUrl: `https://btc.union.build/explorer/transfers/${sort_order_tx}`
534+
})(Effect.log(`[TRANSFER_ERROR] >${timeframeMs}ms since send`))
535+
// console.info("[TRANSFER_ERROR] >${timeframeMs}ms since send")
544536
reportedSendTxHashes.add(sendTxHash)
545537
continue
546538
}

0 commit comments

Comments
 (0)