forked from hyperledger-archives/aries-framework-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.
-provided logging interface -log levels supported - CRITICAL, ERROR, WARNING, INFO, DEBUG, where INFO is default logging level -logging provider implementation can be used to provide custom logging provider -resolves hyperledger-archives#21 Signed-off-by: sudesh.shetty <[email protected]>
- Loading branch information
1 parent
3000859
commit 7fb9fde
Showing
1 changed file
with
46 additions
and
0 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,46 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package log | ||
|
||
// Level defines all available log levels for logging messages. | ||
type Level int | ||
|
||
// Log levels. | ||
const ( | ||
CRITICAL Level = iota | ||
ERROR | ||
WARNING | ||
INFO //default logging level | ||
DEBUG | ||
) | ||
|
||
//Logger - Standard logger interface | ||
type Logger interface { | ||
|
||
//Fatalf is critical fatal logging, should possibly followed by a call to os.Exit(1) | ||
Fatalf(msg string, args ...interface{}) | ||
|
||
//Panicf is critical logging, should possibly followed by panic | ||
Panicf(msg string, args ...interface{}) | ||
|
||
//Debugf is for logging verbose messages | ||
Debugf(msg string, args ...interface{}) | ||
|
||
//Infof for logging general logging messages | ||
Infof(msg string, args ...interface{}) | ||
|
||
//Warnf is for logging messages about possible issues | ||
Warnf(msg string, args ...interface{}) | ||
|
||
//Errorf is for logging errors | ||
Errorf(msg string, args ...interface{}) | ||
} | ||
|
||
// LoggerProvider is a factory for moduled loggers | ||
type LoggerProvider interface { | ||
GetLogger(module string) Logger | ||
} |