Comparison

util/logger.lua @ 4937:b3fe52353295

util.logger: Remove some redundant code
author Matthew Wild <mwild1@gmail.com>
date Mon, 25 Jun 2012 00:16:08 +0100
parent 4627:b046cafc81a8
child 5776:bd0ff8ae98a8
comparison
equal deleted inserted replaced
4936:92c86e11fd44 4937:b3fe52353295
21 local log_debug = make_logger(name, "debug"); 21 local log_debug = make_logger(name, "debug");
22 local log_info = make_logger(name, "info"); 22 local log_info = make_logger(name, "info");
23 local log_warn = make_logger(name, "warn"); 23 local log_warn = make_logger(name, "warn");
24 local log_error = make_logger(name, "error"); 24 local log_error = make_logger(name, "error");
25 25
26 --name = nil; -- While this line is not commented, will automatically fill in file/line number info
27 local namelen = #name;
28 return function (level, message, ...) 26 return function (level, message, ...)
29 if level == "debug" then 27 if level == "debug" then
30 return log_debug(message, ...); 28 return log_debug(message, ...);
31 elseif level == "info" then 29 elseif level == "info" then
32 return log_info(message, ...); 30 return log_info(message, ...);