lua调用c函数 #1681
Answered
by
hanxi
sanergogogo
asked this question in
Q&A
lua调用c函数
#1681
-
local skynet = require "skynet"
require "skynet.manager"
local logger = require "log.core"
local CMD = {}
function CMD.start()
print(table.dump(logger))
print(logger.init, logger.info, logger["exit"])
logger.init(tonumber(skynet.getenv("log_level")) or 0,
tonumber(skynet.getenv("log_rollsize")) or 1024,
tonumber(skynet.getenv("log_flushinterval")) or 5,
skynet.getenv("log_dirname") or "log",
skynet.getenv("log_basename") or "test")
end
function CMD.stop( )
logger.exit()
end
function CMD.debug(name, msg)
logger.debug(string.format("%s [%s] %s",os.date("%Y-%m-%d %H:%M:%S"), name, msg))
end 输出结果
运行在linux下是没问题的,所以c函数注册应该是没问题的。 |
Beta Was this translation helpful? Give feedback.
Answered by
hanxi
Dec 7, 2022
Replies: 4 comments 11 replies
-
您好,您发给我的邮件已收到。
|
Beta Was this translation helpful? Give feedback.
0 replies
-
可能要看看 log.core 是怎么实现的? |
Beta Was this translation helpful? Give feedback.
11 replies
Answer selected by
sanergogogo
-
很久之前,我编译 OPENSSL 遇到过类似的问题。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
可能要看看 log.core 是怎么实现的?