1234567891011121314151617181920212223242526272829303132333435363738394041424344454647(*********************************************************************************)(* pplumbing - Utility libraries to use with [pp] *)(* SPDX-FileCopyrightText: 2024-2025 Mathieu Barbin <mathieu.barbin@gmail.com> *)(* SPDX-License-Identifier: MIT *)(*********************************************************************************)typelevel=Logs.leveltypesrc=Logs.srcletrenderfmtpps=letpp=Pp.vbox(Pp.concat_mappps~sep:Pp.cut~f:Pp.box)iniffmt==Format.std_formatterthenPp_tty.Ansi_color.print(Pp.map_tagspp~f:Pp_tty.Print_config.default)elseiffmt==Format.err_formatterthenPp_tty.Ansi_color.prerr(Pp.map_tagspp~f:Pp_tty.Print_config.default)elsePp.to_fmtfmtpp;;typelog=?header:string->?tags:(unit->Logs.Tag.set)->(unit->Pp_tty.tlist)->unitletmsg?srclevel?header?tagsf=Logs.msg?srclevel(funm->m?header?tags:(Option.map(funtags->tags())tags)"%a"render(f()));;letapp?src?header?tagsf=msg?srcApp?header?tagsfleterr?src?header?tagsf=msg?srcError?header?tagsfletwarn?src?header?tagsf=msg?srcWarning?header?tagsfletinfo?src?header?tagsf=msg?srcInfo?header?tagsfletdebug?src?header?tagsf=msg?srcDebug?header?tagsfmoduleLogs=structtypemsgf=?header:string->?tags:Logs.Tag.set->Pp_tty.tlist->unittypelog=(msgf->unit)->unitletmsg?srclevelf=Logs.msg?srclevel(funm->f(fun?header?tagspp->m?header?tags"%a"renderpp));;letapp?srcf=msg?srcAppfleterr?srcf=msg?srcErrorfletwarn?srcf=msg?srcWarningfletinfo?srcf=msg?srcInfofletdebug?srcf=msg?srcDebugfend