Software /
code /
prosody
Annotate
teal-src/util/logger.d.tl @ 12701:8e402a2ae1b8
util.jwt: Overhaul of tests to use declarative approach
Now we can consistently apply the same tests to every algorithm, instead of
duplicating code.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 02 Jul 2022 14:22:20 +0100 |
parent | 12621:041d067de38b |
rev | line source |
---|---|
12621
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 local record util |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 enum loglevel |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 "debug" |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 "info" |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 "warn" |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 "error" |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 end |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 type logger = function ( loglevel, string, ...:any ) |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 type sink = function ( string, loglevel, string, ...:any ) |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 type simple_sink = function ( string, loglevel, string ) |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 init : function ( string ) : logger |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 make_logger : function ( string, loglevel ) : function ( string, ...:any ) |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 reset : function () |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 add_level_sink : function ( loglevel, sink ) |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 add_simple_sink : function ( simple_sink, { loglevel } ) |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 end |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 |
041d067de38b
util.logger: Add Teal interface description
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 return util |