All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scribe.slack.SlackWriter.scala Maven / Gradle / Ivy

There is a newer version: 3.15.3
Show newest version
package scribe.slack

import scribe.LogRecord
import scribe.output.LogOutput
import scribe.output.format.OutputFormat
import scribe.writer.Writer
import cats.effect.unsafe.implicits.global

/**
  * SlackWriter is
  *
  * @param slack Slack instance
  * @param emojiIcon the emoji to use when sending messages
  */
class SlackWriter(slack: Slack, emojiIcon: String) extends Writer {

  override def write(record: LogRecord, output: LogOutput, outputFormat: OutputFormat): Unit = slack.request(
    message = output.plainText,
    emojiIcon = emojiIcon
  ).unsafeRunAndForget()

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy