bend-kit-notch Releases (5): 0.4.0.0 0xf0e23e9c9480f1483369504991b64bfc indexed https://jend.leeeet.dev/files.txt?path=bend-kit-notch@0.4.0.0 0.3.0.0 0x37a351f1bb11f54b0a006430f6d12191 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-notch@0.3.0.0 0.2.0.0 0xfa8b1ffd075ee48f371a87df77a7fadb invalid https://jend.leeeet.dev/files.txt?path=bend-kit-notch@0.2.0.0 expected a fresh constructor name (duplicate declaration: Text) At https://jend.leeeet.dev/read.txt?path=bend-kit-notch@0.2.0.0/notch.bend&start_line=21. Files that do not load: notch.bend. 0.1.0.1 0x1e7155d6d6e198f44e61502f9f6c0114 invalid https://jend.leeeet.dev/files.txt?path=bend-kit-notch@0.1.0.1 expected a fresh constructor name (duplicate declaration: Text) At https://jend.leeeet.dev/read.txt?path=bend-kit-notch@0.1.0.1/notch.bend&start_line=22. Files that do not load: notch.bend. 0.1.0.0 0x3ce6d24a9280c01a2032d333116bd6c8 invalid https://jend.leeeet.dev/files.txt?path=bend-kit-notch@0.1.0.0 expected a fresh constructor name (duplicate declaration: Text) At https://jend.leeeet.dev/read.txt?path=bend-kit-notch@0.1.0.0/notch.bend&start_line=22. Files that do not load: notch.bend. Definitions (44): Notch.Level (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=Level) type Level is Data: Debug{} Info{} Warn{} Error{} Notch.Value (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=Value) type Value is Data: Str{s: String} Num{n: U32} Flag{b: Bool} Notch.Field (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=Field) type Field is Data: Field{key: String, val: Value} Notch.Format (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=Format) # Logfmt is written as Go's slog TextHandler writes it. Json is one object per line. type Format is Data: Logfmt{} Json{} Notch.Logger (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=Logger) # ctx holds the fields from with, oldest first. A line puts them before its own fields. type Logger is Data: Logger{min: Level, format: Format, ctx: List<&2, Field>} Notch.Level.rank (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=Level.rank) def Level.rank(l: Level) -> Nat: Notch.Level.name (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=Level.name) def Level.name(l: Level) -> String: Notch.text (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=text) def text(min: Level) -> Logger: Notch.json (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=json) def json(min: Level) -> Logger: Notch.with (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=with) # A logger that adds fs to every line, after the fields it already adds. def with(lg: Logger, fs: List<&2, Field>) -> Logger: Notch.enabled (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=enabled) def enabled(lg: Logger, lvl: Level) -> Bool: Notch.str (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=str) def str(k: String, v: String) -> Field: Notch.num (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=num) def num(k: String, n: U32) -> Field: Notch.flag (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=flag) def flag(k: String, b: Bool) -> Field: Notch.hex (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=hex) def hex(+n: U32) -> Char: Notch.esc.ctl (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=esc.ctl) def esc.ctl(ctl: Bool, +c: U32, rest: String) -> String: Notch.esc.c (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=esc.c) # JSON (RFC 8259 ยง7): quote, backslash and control chars are escaped. def esc.c(+c: U32, rest: String) -> String: Notch.esc (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=esc) def esc(s: String, rest: String) -> String: Notch.quote (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=quote) def quote(s: String) -> String: Notch.bare.c (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=bare.c) # A bare logfmt token has no whitespace, controls, '=', quote or DEL. def bare.c(+c: U32) -> Bool: Notch.bare.go (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=bare.go) def bare.go(s: String) -> Bool: Notch.bare (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=bare) def bare(s: String) -> Bool: Notch.tq.if (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=tq.if) def tq.if(ok: Bool, s: String) -> String: Notch.tq (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=tq) # A logfmt key or string value: bare when it can be, else a JSON string. def tq(+s: String) -> String: Notch.Bool.word (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=Bool.word) def Bool.word(b: Bool) -> String: Notch.Value.text (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=Value.text) def Value.text(v: Value) -> String: Notch.Value.json (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=Value.json) def Value.json(v: Value) -> String: Notch.fields.text (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=fields.text) def fields.text(fs: List<&2, Field>) -> String: Notch.fields.json (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=fields.json) def fields.json(fs: List<&2, Field>) -> String: Notch.time.text (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=time.text) def time.text(t: Maybe<&2, String>) -> String: Notch.time.json (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=time.json) def time.json(t: Maybe<&2, String>) -> String: Notch.render.as (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=render.as) def render.as(f: Format, t: Maybe<&2, String>, lvl: Level, msg: String, fs: List<&2, Field>) -> String: Notch.render (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=render) # One line, without its newline, whatever the level. t is the time text; None leaves it out. def render(lg: Logger, t: Maybe<&2, String>, lvl: Level, msg: String, fs: List<&2, Field>) -> String: Notch.line.if (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=line.if) def line.if(on: Bool, lg: Logger, t: Maybe<&2, String>, lvl: Level, msg: String, fs: List<&2, Field>) -> Maybe<&2, String>: Notch.line (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=line) # The line, or None when lvl is below the logger's level. A dropped line is never rendered. def line(+lg: Logger, t: Maybe<&2, String>, +lvl: Level, msg: String, fs: List<&2, Field>) -> Maybe<&2, String>: Notch.stamp (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=stamp) def stamp(lg: Logger, lvl: Level, msg: String, fs: List<&2, Field>) -> IO(String): Notch.log.if (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=log.if) def log.if(on: Bool, lg: Logger, lvl: Level, msg: String, fs: List<&2, Field>) -> IO(Unit): Notch.log (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=log) # Writes the line to stderr, stamped with the wall clock in RFC 3339. Below the logger's level, it reads no clock. def log(+lg: Logger, +lvl: Level, msg: String, fs: List<&2, Field>) -> IO(Unit): Notch.file.if (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=file.if) # Write a stamped line and newline to a File; the returned handle must be kept or closed. # Below the logger's level, returns the same handle and Done without a clock read or write. def file.if(on: Bool, h: File, lg: Logger, lvl: Level, msg: String, fs: List<&2, Field>) -> IO(File & Result<&1, &1, U32 & String, Unit>): Notch.file (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=file) def file(h: File, +lg: Logger, +lvl: Level, msg: String, fs: List<&2, Field>) -> IO(File & Result<&1, &1, U32 & String, Unit>): Notch.debug (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=debug) def debug(lg: Logger, msg: String, fs: List<&2, Field>) -> IO(Unit): Notch.info (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=info) def info(lg: Logger, msg: String, fs: List<&2, Field>) -> IO(Unit): Notch.warn (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=warn) def warn(lg: Logger, msg: String, fs: List<&2, Field>) -> IO(Unit): Notch.error (https://jend.leeeet.dev/definition.txt?path=bend-kit-notch@0.4.0.0/notch.bend&name=error) def error(lg: Logger, msg: String, fs: List<&2, Field>) -> IO(Unit):