forked from compound-finance/comet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add googleCloudLog, improve logging of info; alert on failed liquidat…
…ion (compound-finance#619) * Add googleCloudLog, improve logging of info; alert on failed liquidation * lint * log useFlashbots
- Loading branch information
1 parent
c80e115
commit 0076d71
Showing
3 changed files
with
42 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
Utility to log data in a structured way that will be reflected in Google Cloud | ||
Platform logs. | ||
Basically, lets you specify a severity level so we can do things like filtering | ||
and alerting in GCP. | ||
https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#LogSeverity | ||
*/ | ||
|
||
export enum LogSeverity { | ||
INFO = 'INFO', // Routine information, such as ongoing status or performance | ||
WARNING = 'WARNING', // Warning events, things that might cause problems | ||
ERROR = 'ERROR', // Error events, things that are likely to cause problems | ||
ALERT = 'ALERT' // A person must take an action immediately; may cause someone to be alerted | ||
} | ||
|
||
export default function googleCloudLog(severity: LogSeverity, message: string) { | ||
console.log(JSON.stringify({ severity, message })); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters