Skip to content

Commit

Permalink
Update timestamp for each action
Browse files Browse the repository at this point in the history
  • Loading branch information
shanefontaine committed May 18, 2021
1 parent 7d96d22 commit 72b987e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,18 +386,21 @@ export async function execScript (cmd: string) {

export const Logger = (label: string) => {
label = `[${label}]`
let timestamp: string = new Date(Date.now()).toISOString().substr(11, 8)
timestamp = `[${timestamp}]`
return {
log: (...args: any[]) => {
console.log(label, timestamp, ...args)
console.log(label, getTimestamp(), ...args)
},
error: (...args: any[]) => {
console.error(label, timestamp, ...args)
console.error(label, getTimestamp(), ...args)
}
}
}

const getTimestamp = (): string => {
let timestamp: string = new Date(Date.now()).toISOString().substr(11, 8)
return `[${timestamp}]`
}

export const getL1ChainIdFromNetworkName = (networkName: string): BigNumber => {
return CHAIN_IDS.ETHEREUM[networkName.toUpperCase()]
}
Expand Down

0 comments on commit 72b987e

Please sign in to comment.