-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(log-mgmt): Refactoring code for better log/error mgmt (#91) Signed-off-by: shubhamchaudhary <shubham.chaudhary@mayadata.io> * chore(resourceRequirements): Adding resource requirements in chaos pod (#93) Signed-off-by: shubhamchaudhary <shubham.chaudhary@mayadata.io> Co-authored-by: Shubham Chaudhary <shubham.chaudhary@mayadata.io>
- Loading branch information
1 parent
d1f71e3
commit 51c72b7
Showing
56 changed files
with
3,140 additions
and
162 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,2 +1,3 @@ | ||
build/_output/ | ||
.idea/ | ||
vendor/modules.txt |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package log | ||
|
||
import ( | ||
logrus "github.com/sirupsen/logrus" | ||
) | ||
|
||
//Fatalf Logs first and then calls `logger.Exit(1)` | ||
// logging level is set to Panic. | ||
func Fatalf(msg string, err error) { | ||
logrus.WithFields(logrus.Fields{}).Fatalf(msg, err) | ||
} | ||
|
||
//Fatal Logs first and then calls `logger.Exit(1)` | ||
// logging level is set to Panic. | ||
func Fatal(msg string) { | ||
logrus.WithFields(logrus.Fields{}).Fatal(msg) | ||
} | ||
|
||
//Infof log the General operational entries about what's going on inside the application | ||
func Infof(msg string, val ...interface{}) { | ||
logrus.WithFields(logrus.Fields{}).Infof(msg, val...) | ||
} | ||
|
||
//Info log the General operational entries about what's going on inside the application | ||
func Info(msg string) { | ||
logrus.WithFields(logrus.Fields{}).Infof(msg) | ||
} | ||
|
||
// InfoWithValues log the General operational entries about what's going on inside the application | ||
// It also print the extra key values pairs | ||
func InfoWithValues(msg string, val map[string]interface{}) { | ||
logrus.WithFields(val).Info(msg) | ||
} | ||
|
||
// ErrorWithValues log the Error entries happening inside the code | ||
// It also print the extra key values pairs | ||
func ErrorWithValues(msg string, val map[string]interface{}) { | ||
logrus.WithFields(val).Error(msg) | ||
} | ||
|
||
//Warn log the Non-critical entries that deserve eyes. | ||
func Warn(msg string) { | ||
logrus.WithFields(logrus.Fields{}).Warn(msg) | ||
} | ||
|
||
//Warnf log the Non-critical entries that deserve eyes. | ||
func Warnf(msg string, val ...interface{}) { | ||
logrus.WithFields(logrus.Fields{}).Warnf(msg, val...) | ||
} | ||
|
||
//Errorf used for errors that should definitely be noted. | ||
// Commonly used for hooks to send errors to an error tracking service. | ||
func Errorf(msg string, err ...interface{}) { | ||
logrus.WithFields(logrus.Fields{}).Errorf(msg, err...) | ||
} | ||
|
||
//Error used for errors that should definitely be noted. | ||
// Commonly used for hooks to send errors to an error tracking service | ||
func Error(msg string) { | ||
logrus.WithFields(logrus.Fields{}).Error(msg) | ||
} |
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
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
Oops, something went wrong.