mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 00:10:20 +00:00
util: add ErrorLog for log with context
added a new function ErrorLog to log with context. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
9229e84a77
commit
7c24f4d597
@ -64,6 +64,12 @@ func ErrorLogMsg(message string, args ...interface{}) {
|
||||
klog.ErrorDepth(1, logMessage)
|
||||
}
|
||||
|
||||
// ErrorLog helps in logging errors with context.
|
||||
func ErrorLog(ctx context.Context, message string, args ...interface{}) {
|
||||
logMessage := fmt.Sprintf(Log(ctx, message), args...)
|
||||
klog.ErrorDepth(1, logMessage)
|
||||
}
|
||||
|
||||
// WarningLog helps in logging warnings.
|
||||
func WarningLog(message string, args ...interface{}) {
|
||||
logMessage := fmt.Sprintf(message, args...)
|
||||
|
Loading…
Reference in New Issue
Block a user