diff options
Diffstat (limited to 'utilities/utilities.go')
| -rw-r--r-- | utilities/utilities.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/utilities/utilities.go b/utilities/utilities.go index 46d5766..b8e416c 100644 --- a/utilities/utilities.go +++ b/utilities/utilities.go @@ -22,6 +22,8 @@ import ( "os" "reflect" "time" + + "github.com/network-quality/goresponsiveness/constants" ) func IsInterfaceNil(ifc interface{}) bool { @@ -121,3 +123,24 @@ func SeekForAppend(file *os.File) (err error) { _, err = file.Seek(0, 2) return } + +func IsDebug(level constants.DebugLevel) bool { + if level <= constants.Debug { + return true + } + return false +} + +func IsWarn(level constants.DebugLevel) bool { + if level <= constants.Warn { + return true + } + return false +} + +func IsError(level constants.DebugLevel) bool { + if level <= constants.Error { + return true + } + return false +} |
