Changeset

461:fa5c40e5e079

Use util.format for logging
author Matthew Wild <mwild1@gmail.com>
date Thu, 16 Mar 2023 11:46:16 +0000
parents 460:a523535d8937
children 462:51c3da615ff4
files init.lua squishy
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/init.lua	Thu Mar 16 11:43:16 2023 +0000
+++ b/init.lua	Thu Mar 16 11:46:16 2023 +0000
@@ -11,6 +11,8 @@
 local events = require "util.events";
 local logger = require "util.logger";
 
+local format = require "util.format".format;
+
 local verse = {};
 verse.server = server;
 
@@ -50,11 +52,6 @@
 verse.new_logger = logger.init;
 verse.log = verse.logger("verse");
 
-local function format(format, ...)
-	local n, arg, maxn = 0, { ... }, select('#', ...);
-	return (format:gsub("%%(.)", function (c) if n <= maxn then n = n + 1; return tostring(arg[n]); end end));
-end
-
 function verse.set_log_handler(log_handler, levels)
 	levels = levels or { "debug", "info", "warn", "error" };
 	logger.reset();
--- a/squishy	Thu Mar 16 11:43:16 2023 +0000
+++ b/squishy	Thu Mar 16 11:46:16 2023 +0000
@@ -20,7 +20,10 @@
 Module "util.uuid"		"util/uuid.lua"
 Module "net.dns"               "net/dns.lua"
 Module "net.adns"              "net/adns.lua"
+Module "util.envload" "util/envload.lua"
 Module "util.id" "util/id.lua"
+Module "util.serialization" "util/serialization.lua"
+Module "util.format" "util/format.lua"
 Module "net.server"		"net/server_select.lua"
 Module "util.xmppstream"	"util/xmppstream.lua"
 Module "util.jid"		"util/jid.lua"
@@ -37,6 +40,7 @@
 Module "util.ip"       "util/ip.lua"
 Module "util.time"		"util/time.lua"
 Module "util.hex" "util/hex.lua"
+Module "util.mathcompat" "util/mathcompat.lua"
 
 Module "util.sasl.scram" "util/sasl/scram.lua"
 Module "util.sasl.plain" "util/sasl/plain.lua"