Pudu programming language
Menu
Package

@chrismichaelps / pudu-lang-log

Structured event logging for Pudu: message templates, enrichment, filtering, formatting, and sinks

0.1.0Apache-2.01

InstallClose

Sources.pudu

Pudu13 lines643 B

GitHub ↗
1/** @Log.Domain.Sources.Module — source context prefixes and their ordering */2module PuduLangLog.Domain.Sources34/// Whether a source context is the prefix or lies beneath it, `App.Web` covering `App.Web.Api`5/// but not `App.Website`, ignoring case.6export fn covers(prefix: Str, source: Str) -> Bool { beneath(prefix.toLower(), source.toLower()) }78/// Whether a source context is the prefix or lies beneath it, with case significant.9export fn beneath(prefix: Str, source: Str) -> Bool {10  if !source.startsWith(prefix) { return false }11  source.length() == prefix.length() || source.slice(prefix.length(), prefix.length() + 1) == "."12}13