-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Logger #4688
[Feature] Logger #4688
Conversation
@@ -338,4 +340,4 @@ | |||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | |||
<ImportGroup Label="ExtensionTargets"> | |||
</ImportGroup> | |||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS autoformater...
@@ -0,0 +1,10 @@ | |||
#log level (debug, info, warning, error, fatal), default debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix default to warning
todo: missing month |
// logger | ||
lua_register(luaState, "logD", LuaScriptInterface::luaLogDebug); | ||
lua_register(luaState, "logI", LuaScriptInterface::luaLogInfo); | ||
lua_register(luaState, "logW", LuaScriptInterface::luaLogWarning); | ||
lua_register(luaState, "logE", LuaScriptInterface::luaLogError); | ||
lua_register(luaState, "logF", LuaScriptInterface::luaLogFatal); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be a class
with some methods
Log.debug("debug")
Log.info("info")
Log.warn("warn")
Log.error("error")
Log.fatal("fatal")
LDEBUG = 0, | ||
LINFO = 1, | ||
LWARNING = 2, | ||
LERROR = 3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L prefix is added to shut up VS, it's complaining about ERROR(is treated as maro to something)
I really dislike the fact that it doesn't even prints error messages on stderr. Also the output looks kinda ugly, especially with these I would probably also replace fatal with trace. |
What's the purpose of making it a separate thread? I would rather keep it simple and just wrap around Boost.Log, which is already thread-safe. |
clarification:
|
It would be better than to write to stdout or stderr and pipe to a file if necessary. So it stays open, managed by the OS
How about using environment variables for that? So you don't need to read any file |
In my opinion, the log size limit is quite significant feature |
Pull Request Prelude
Changes Proposed
Logger that can handle LUA and C++ calls.
logger.conf - logger config file, not required
Issues addressed:
Lack of true logger.