Git Product home page Git Product logo

monolog-telegram's People

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

theavuth9

monolog-telegram's Issues

Output context as code?

Currently, running something like Log::info('this is a test', ['key' => 'value']); leads to output like this in Telegram:

2022-06-28 01:34:15
‍🗨INFO: this is a test
[{"key":"value"}]

So far, so good, right? Now, the issue comes in the $context portion of things, which I would like to be able to format as code, as the monospaced font in Telegram makes context-lines like this much easier to read. In Telegram, which follows Markdown formatting principles, it's as easy as appending backticks before and after the text you want to display as code, or (in case you have multiple lines), triple backticks before the lines and after the lines.

The output I would want to see looks more like this:

2022-06-28 01:34:15
‍🗨INFO: this is a test
[{"key":"value"}]

Filter by severity?

Most Monolog loggers allow you to fiter by minimum level, something I find sorely missing in this particular package (which is otherwise very good!). For example, in a typical laravel configuration, I can do something like this:

'single' => [
    'driver' => 'single',
    'path'   => storage_path('logs/laravel.log'),
    'level'  => 'info',
],

The resulting logs would only show logs with severity "info" or greater, as understood by rfc5424 (DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY), meaning anything of severity "debug" would not end up in the log file.

If you want, I can do a pull request with the relevant functionality, but I wanted to give you the chance to take care of it first.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.