]> source.dussan.org Git - rspamd.git/commitdiff
Improve lua logging format
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 15 Dec 2015 18:27:41 +0000 (18:27 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 15 Dec 2015 18:27:41 +0000 (18:27 +0000)
src/lua/lua_logger.c

index d82237f5527be2d431004be81f379cb551629508..bb566ee82b6c6847ad2c38da911e4536134bb58c 100644 (file)
@@ -157,8 +157,16 @@ lua_common_log_line (GLogLevelFlags level, lua_State *L,
                else {
                        p++;
                }
-               rspamd_snprintf (func_buf, sizeof (func_buf), "%s:%d", p,
-                               d.currentline);
+
+               if (strlen (p) > 20) {
+                       rspamd_snprintf (func_buf, sizeof (func_buf), "%10s...]:%d", p,
+                                       d.currentline);
+               }
+               else {
+                       rspamd_snprintf (func_buf, sizeof (func_buf), "%s:%d", p,
+                                       d.currentline);
+               }
+
                if (level == G_LOG_LEVEL_DEBUG) {
                        rspamd_conditional_debug (NULL,
                                        NULL,