Documentation

FormatterInterface
in

Log formatter interface

Tags
category

Pop

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
5.0.0

Table of Contents

Methods

format()  : string
Format a single log entry into a string

Methods

format()

Format a single log entry into a string

public format(string $level, string $message, array<string|int, mixed> $context) : string

Implementations that embed level/message/context values into a line-delimited or otherwise unescaped text format are responsible for sanitizing them via Pop\Log\Context::sanitize() — Writer\File does not pre-sanitize before calling this method, since not every format needs it (e.g. JSON's own encoding already escapes control characters safely within string values).

Parameters
$level : string
$message : string
$context : array<string|int, mixed>
Return values
string

        
On this page

Search results