code: def __init__(self):
      from slack_sdk import WebClient
  
      self.token = os.getenv("SLACK_TOKEN")
      if not self.token:
          print(
              "The use of slack logging requires the user to set a user specific slack User OAuth token to the SLACK_TOKEN environment variable. Set this variable by 'export SLACK_TOKEN=your_token'. To generate your token please visit https://api.slack.com/authentication/token-types#user."
          )
          exit(-1)
      self.slack = WebClient(self.token)
      # Check for success
      try:
          auth = self.slack.auth_test().data
      except Exception:
          print(
              "Slack connection failed. Please compare your provided slack token exported in the SLACK_TOKEN environment variable with your online token (app). This token can be tested at https://api.slack.com/methods/auth.test/test. A different token can be set up by 'export SLACK_TOKEN=your_token'."
          )
          exit(-1)
      self.own_id = auth["user_id"]
      self.error_occured = False
      self.slack.chat_postMessage(
          channel=self.own_id, text="Snakemake has connected."
      )
  
imports: import logging
  import platform
  import time
  import datetime
  import sys
  import os
  import json
  import threading
  from functools import partial
  import inspect
  import textwrap
label_desc: Use image node_id 1 to create a new SlackLogger object  with example: obj = SlackLogger()