GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - claudetech/python-slack-log: Python Slack log handler using webhook

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
slack_log_handler
slack_log_handler
 
 
.gitignore
.gitignore
 
 
.python-version
.python-version
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 
sample.py
sample.py
 
 
setup.py
setup.py
 
 

Repository files navigation

Python Slack log handler

Simple Python log handler for Slack using Slack webhooks.

Installation

$ pip install slack_log_handler

Usage

The only required argument for SlackLogHandler is the webhook URL. You can pass the channel, username, or a dictionary of emojis for each log level as named arguments.

Sample usage:

import os
import logging
from slack_log_handler import SlackLogHandler

WEBHOOK_URL = os.getenv('SLACK_URL')

slack_handler = SlackLogHandler(WEBHOOK_URL)
slack_handler.setLevel(logging.WARNING)

logger = logging.getLogger(__name__)
logger.addHandler(slack_handler)

logger.error('Oh my god, an error occurred!')

Troubleshooting

On Linux, if you get an error of this kind,

SSL: CERTIFICATE_VERIFY_FAILED

make sure the ca-certificates package (or whatever package your distribution uses instead) is installed.

About

Python Slack log handler using webhook

pypi.python.org/pypi/slack_log_handler

Resources

Readme
MIT license
Activity
Custom properties

Stars

31 stars

Watchers

5 watching

Forks

7 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.