Changeset

12621:041d067de38b

util.logger: Add Teal interface description
author Kim Alvefur <zash@zash.se>
date Sun, 24 Jul 2022 21:39:07 +0200
parents 12620:09d86413c3c5
children 12622:ef59fb975d3e
files teal-src/util/logger.d.tl
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/teal-src/util/logger.d.tl	Sun Jul 24 21:39:07 2022 +0200
@@ -0,0 +1,18 @@
+local record util
+	enum loglevel
+		"debug"
+		"info"
+		"warn"
+		"error"
+	end
+	type logger = function ( loglevel, string, ...:any )
+	type sink = function ( string, loglevel, string, ...:any )
+	type simple_sink = function ( string, loglevel, string )
+	init : function ( string ) : logger
+	make_logger : function ( string, loglevel ) : function ( string, ...:any )
+	reset : function ()
+	add_level_sink : function ( loglevel, sink )
+	add_simple_sink : function ( simple_sink, { loglevel } )
+end
+
+return util