summaryrefslogtreecommitdiff
path: root/efl/utils
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2013-11-28 20:56:37 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2013-11-28 20:56:37 +0200
commit7271d53fc04cab113024de0ba823f1ac2b664175 (patch)
tree6eeac421efbbfe50272a22b1f2fb73430b71337e /efl/utils
parent603476f176da8ee8837be72a2ed3d5953d86e87b (diff)
Utils.logger: Move log buffer to module space, increase size to 1KB
Diffstat (limited to 'efl/utils')
-rw-r--r--efl/utils/logger.pyx11
1 files changed, 6 insertions, 5 deletions
diff --git a/efl/utils/logger.pyx b/efl/utils/logger.pyx
index 22ce861..cd27cc3 100644
--- a/efl/utils/logger.pyx
+++ b/efl/utils/logger.pyx
@@ -43,17 +43,18 @@ cdef tuple log_levels = (
43 43
44cdef dict loggers = dict() 44cdef dict loggers = dict()
45 45
46cdef char log_buf[1024]
47
46cdef void py_eina_log_print_cb(const_Eina_Log_Domain *d, 48cdef void py_eina_log_print_cb(const_Eina_Log_Domain *d,
47 Eina_Log_Level level, 49 Eina_Log_Level level,
48 const_char *file, const_char *fnc, int line, 50 const_char *file, const_char *fnc, int line,
49 const_char *fmt, void *data, va_list args) with gil: 51 const_char *fmt, void *data, va_list args) with gil:
50 cdef: 52 cdef:
51 char tmp[256] 53 unicode msg
52 cdef unicode msg 54 unicode name = d.name.decode("utf-8")
53 cdef unicode name = d.name.decode("utf-8")
54 55
55 vsprintf(tmp, fmt, args) 56 vsprintf(log_buf, fmt, args)
56 msg = tmp.decode("utf-8") 57 msg = log_buf.decode("utf-8")
57 58
58 rec = logging.LogRecord(name, log_levels[level], file, line, msg, None, None, fnc) 59 rec = logging.LogRecord(name, log_levels[level], file, line, msg, None, None, fnc)
59 logger = loggers.get(name, loggers["efl"]) 60 logger = loggers.get(name, loggers["efl"])