diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 00f7b55..a52ab9c 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,17 +1,10 @@ - + - - - - - - - @@ -188,17 +188,7 @@ - - - - - - file://$PROJECT_DIR$/func.go - 49 - - - + + \ No newline at end of file diff --git a/example/main.go b/example/main.go index c5cb4f3..71d64f4 100644 --- a/example/main.go +++ b/example/main.go @@ -72,6 +72,7 @@ func main() { // // return true //}) + hotime.LogError("dasdasdasdasdas") this.Display(5, "dsadas") }, "websocket": func(this *hotime.Context) { diff --git a/func.go b/func.go index 9e4efad..5fc134b 100644 --- a/func.go +++ b/func.go @@ -29,10 +29,23 @@ import ( // return res //} -func LogFmt(logMsg interface{}, loglevel ...LOG_MODE) { +func LogError(logMsg interface{}) { - logFmt(logMsg, 2, loglevel...) + logFmt(fmt.Sprintln(logMsg), 2, LOG_ERROR) } +func LogWarn(logMsg interface{}) { + + logFmt(fmt.Sprintln(logMsg), 2, LOG_WARN) +} +func LogInfo(logMsg ...interface{}) { + + logFmt(fmt.Sprintln(logMsg), 2, LOG_INFO) +} + +//func LogFmt(logMsg interface{}, loglevel ...LOG_MODE) { +// +// logFmt(logMsg, 2, loglevel...) +//} //日志打印以及存储到文件 func logFmt(logMsg interface{}, printLevel int, loglevel ...LOG_MODE) {