diff options
Diffstat (limited to 'src/comet.c')
| -rw-r--r-- | src/comet.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/comet.c b/src/comet.c index 9be94bf..f74cfda 100644 --- a/src/comet.c +++ b/src/comet.c @@ -12,14 +12,20 @@ #include "lua/api.h" #ifdef RELEASE -#define ANY_LOG_NO_TRACE +#define ANY_LOG_FORMAT_BEFORE(stream, level, module, func) \ + fprintf(stream, "[%s] %s%s%s: ", \ + func, ANY_LOG_COLOR_GET(level), any_log_level_strings[level], ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET)) + +#define ANY_LOG_VALUE_BEFORE(stream, level, module, func, message) \ + fprintf(stream, "[%s] %s%s%s: %s [", \ + func, ANY_LOG_COLOR_GET(level), any_log_level_strings[level], ANY_LOG_COLOR_GET(ANY_LOG_COLOR_RESET), message) #endif #define ANY_LOG_VALUE_STRING(stream, key, value) \ fprintf(stream, "%s=\"%s\"", key, value ? value : "(null)") #define ANY_LOG_IMPLEMENT -#include "any_log.h" +#include "log.h" static sig_atomic_t running = true; @@ -73,6 +79,7 @@ int main(int argc, char **argv) lua_api_t lua; lua_api_init(&lua); + (void)luaL_dostring(lua.state, "log.warn('hello')"); if (luaL_dofile(lua.state, "example.lua") != LUA_OK) { const char *error_message = lua_tostring(lua.state, -1); log_error("Lua script failed: %s", error_message); |
