localfunctionlogger(str,color)returnfunction(...)skynet.error(string.format("%s%s\x1b[0m",color,str),...)endend-- 把DEBUG日志打印成蓝色localDEBUG=logger("[D]","\x1b[34m")-- 把INFO日志打印成绿色localINFO=logger("[I]","\x1b[32m")-- 把WARN日志打印成白色localWARN=logger("[W]","\x1b[33m")-- 把错误日志打印成红色localERROR=logger("[E]","\x1b[31m")DEBUG("this is a debug log")