tylercd100 / lern

LERN is a Laravel 5 package that will record exceptions into a database and will notify you via Email, Pushover or Slack.
MIT License
441 stars 37 forks source link

Formatting message #40

Open loranger opened 8 years ago

loranger commented 8 years ago

Hello (and thank you for this useful package)

I'd like to format a bit my error message.

I was wondering where I was supposed to write down my LERN::setMessage closure, so I put it in my Exceptions/Handler.php file, inside my report method:

if (app()->bound("lern")) {
                app()->make("lern")->setMessage(function ($exception) {
...

Am I doing right ?

I'm also trying to format my exceptions notification message and that's the aim of this issue. I mainly use slack and I'm trying to beautify a bit the messages. I tried to create new lines and add some bold such as

$msg .= "*URL*: {$method}@<{$url}>\r\n" . PHP_EOL;

But i doesn't work.

It seems a config flag mrkdwn have to be set to true but I can't figure out how and where I can do it.

Could you help, please ?

tylercd100 commented 8 years ago

Hey @loranger , please give version 3.6.6 a try. Let me know if it fixes the issue with new lines

Yes you are using the setMessage method correctly :-)

loranger commented 8 years ago

That's much better, indeed. I still miss the slack formatting (kind of minimal markdown) but at least, the reports are definitely readable !

Thank you so much !

By the way, It would be useful to being able to get the id of the current recorded exception from the notification itself. That would be helpful to add a link to the current full and formatted exception from the notification message.

TUNER88 commented 7 years ago

@tylercd100 is it possible to add markdown support for slack channel, to make the messages more readable?

Basic code formatting like in Cherry-Pie/LogEnvelope package would make messages more readable!

TUNER88 commented 7 years ago

@tylercd100 I still have problems with markdown rendering on the latest version. Markdown markup looks like normal text, any idea how to fix it?