提交 1f146fd4 编写于 作者: 梦境迷离's avatar 梦境迷离

fix some

上级 0f8c8d44
......@@ -68,6 +68,11 @@ object elapsedMacro {
case "info" => getLog(classNameAndMethodName, q"${log.get}.info")
case "debug" => getLog(classNameAndMethodName, q"${log.get}.debug")
case "warn" => getLog(classNameAndMethodName, q"${log.get}.warn")
case _ =>
c.abort(
c.enclosingPosition,
s"${extractOptions._2.toLowerCase} is not in the supported list: info,debug,warn"
)
}
}
}
......
......@@ -44,10 +44,7 @@ object logMacro {
evalTree(logType.asInstanceOf[Tree])
case q"new log()" => LogType.JLog
case _ =>
c.abort(
c.enclosingPosition,
s"${ErrorMessage.UNEXPECTED_PATTERN}, only support: ${LogType.values.mkString(",")}"
)
c.abort(c.enclosingPosition, s"${ErrorMessage.UNEXPECTED_PATTERN}")
}
private def logTree(annottees: Seq[c.universe.Expr[Any]]): c.universe.Tree = {
......
......@@ -47,6 +47,9 @@ object LogType {
val values = types.keySet
def getLogImpl(logType: String): BaseLog =
types.getOrElse(logType.toLowerCase, default = throw new Exception(s"Not support log type: $logType"))
types.getOrElse(
logType.toLowerCase,
default = throw new Exception(s"$logType is not in the supported list: ${values.mkString(",")}")
)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册