Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Option to preformat messages by wrapping it with triple backquotes #87

Open
@aeroastro

Description

@aeroastro

Summary

Since log messages often contains special characters in markdown, I would like to forward messages in code blocks.

some error messages lib/foo.rb:100:in `initialize'

(NOTE: This is an example for GitHub flavored markdown, and we need to use different format for Slack.)

Background

I am using Slack now, and this Plugin is really useful to forward messages. I am mainly using the plugin to send some error messages to Slack.

The problem here is that since the message often contains special characters, we often see some malformated messages.

Current Message Example

Following are the sample messages sent to Slack (Ruby error message with backtrace and URL path). Although this is formatted with GitHub flavored markdown, it still shows the underlying problems on Slack notification.

ERROR -- : Faraday::ConnectionFailed (execution expired) at lib/foo.rb:100:ininitialize' <<< lib/bar.rb:7:ininitialize', path: /path/to/api?matcher1=&matcher2=hoge&matcher3=

Here, we can see the following problems, and I believe this is pretty common when handling log messages.

  • line numbers is converted into emoji 💯
  • backquotes indicating method makemispaired inline code
  • asterisks in path make partial textitalic

Proposed Solution

I just would like to make the message preformatted with``` like the GitHub app for Slack.

image

This can be achieved by improving the following line and adding some options.

returnString.format("%s*%s in Graylog stream %s*:\n> %s",audience,messageLink,titleLink,msg.getMessage());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp