forked from zama-ai/fhevm-go
-
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.
- Loading branch information
1 parent
14d4271
commit d80371f
Showing
4 changed files
with
29 additions
and
5 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 |
---|---|---|
@@ -1,8 +1,32 @@ | ||
package fhevm | ||
|
||
import "fmt" | ||
|
||
// A Logger interface for the EVM. | ||
type Logger interface { | ||
Debug(msg string, keyvals ...interface{}) | ||
Info(msg string, keyvals ...interface{}) | ||
Error(msg string, keyvals ...interface{}) | ||
} | ||
|
||
// A default Logger implementation that logs to stdout. | ||
type DefaultLogger struct{} | ||
|
||
func toString(keyvals ...interface{}) (ret string) { | ||
for _, element := range keyvals { | ||
ret += fmt.Sprintf("%v", element) + " " | ||
} | ||
return | ||
} | ||
|
||
func (*DefaultLogger) Debug(msg string, keyvals ...interface{}) { | ||
fmt.Println("Debug: "+msg, toString(keyvals...)) | ||
} | ||
|
||
func (*DefaultLogger) Info(msg string, keyvals ...interface{}) { | ||
fmt.Println("Info: "+msg, toString(keyvals...)) | ||
} | ||
|
||
func (*DefaultLogger) Error(msg string, keyvals ...interface{}) { | ||
fmt.Println("Error: "+msg, toString(keyvals...)) | ||
} |
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
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