brille24/markdown-formatter

Formatting a stacktrace with markdown for monolog

1.0.9 2022-10-13 19:33 UTC

This package is auto-updated.

Last update: 2024-11-13 23:59:17 UTC


README

A formatter that prints the stack trace in markdown like so:

❗ Exception occurred here:

Context:

{
    "failed_test": "some tests failed."
}

Usage

composer require brille24/markdown-formatter

Define the class Brille24\MarkdownFormatter\MarkdownFormatter as a service and use it (assuming that auto-wiring is on):

monolog:
    type: 'service'
    id: "Brille24\\MarkdownFormatter\\MarkdownFormatter"

If you want to customize the base path that the location is relative to you can pass the first argument to the root of the project eg.

service:
    Brille24\MarkdownFormatter\MarkdownFormatter:
        arguments:
            - '/some/path/to/the/project'