diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-06-27 17:33:06 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-06-27 17:33:06 +0200 |
commit | 8236f3afa2eca0aae6c5da9560301c04d882c81b (patch) | |
tree | 5babaff66d6709f7f1fcdba69847ac684d1ef3de /src/logger.go | |
parent | eb75ff430d1f78e129bbfe49d612f241ca418df4 (diff) |
Implemented MAC1/2 calculation
Diffstat (limited to 'src/logger.go')
-rw-r--r-- | src/logger.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/logger.go b/src/logger.go new file mode 100644 index 0000000..117fe5b --- /dev/null +++ b/src/logger.go @@ -0,0 +1,35 @@ +package main + +import ( + "log" + "os" +) + +const ( + LogLevelError = iota + LogLevelInfo + LogLevelDebug +) + +type Logger struct { + Debug *log.Logger + Info *log.Logger + Error *log.Logger +} + +func NewLogger() *Logger { + logger := new(Logger) + logger.Debug = log.New(os.Stdout, + "DEBUG: ", + log.Ldate|log.Ltime|log.Lshortfile, + ) + logger.Info = log.New(os.Stdout, + "INFO: ", + log.Ldate|log.Ltime|log.Lshortfile, + ) + logger.Error = log.New(os.Stdout, + "ERROR: ", + log.Ldate|log.Ltime|log.Lshortfile, + ) + return logger +} |