Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
The Logging Discord is a tool that simplifies the logging of error messages to a Discord channel. It allows you to send error messages with custom information, including a traceback and specific messages
Logging Discord
is a tool that streamlines error message logging to a Discord channel. It enables the sending of tracebacks and custom specific information messages. Below, you will find details, parameters and methods, as well as usage examples.
pip install logging_discord
from logging_discord import LogDiscord
log_discord = LogDiscord(webhook='https://your_discord_channel_webhook')
log_discord.send(log_level=1) # 0 = unknown, 1 = debug, 2 = info, 3 = warning, 4 = error, 5 = critical
discord_config.py
You can configure the parameters of the LogDiscord
class by creating a file called 'discord_config.py' at the root of the project. The 'discord_config.py' file should contain the following configurations:
Example:
channel = {
'webhook': 'https://discord.com/api/webhooks/example',
'avatar_url': 'https://i0.wp.com/www.theterminatorfans.com/wp-content/uploads/2012/09/the-terminator3.jpg?resize=900%2C450&ssl=1',
'mode': 'DEVELOPMENT',
'app_name': 'APP_TEST',
}
log_levels = {
# color legend:
# * UNKNOWN: 0 = Black
# * DEBUG: 35840 = Green
# * INFO: 2196944 = Blue
# * WARNING: 16497928 = Yellow
# * ERROR: 16729344 = Red Orange
# * CRITICAL: 12255250 = Red
0: {
'emoji': ':thinking: ',
'title': 'UNKNOWN',
'color': 0,
},
1: {'emoji': ':beetle: ', 'title': 'DEBUG', 'color': 35840},
2: {
'emoji': ':information_source: ',
'title': 'INFO',
'color': 2196944,
},
3: {
'emoji': ':warning: ',
'title': 'WARNING',
'color': 16497928,
},
4: {'emoji': ':x: ', 'title': 'ERROR', 'color': 16729344},
5: {'emoji': ':sos: ', 'title': 'CRITICAL', 'color': 12255250},
}
Here are some examples of how to use the LogDiscord
class:
# Creating a logger instance
logger = LogDiscord(webhook="your_webhook_url", avatar_url="avatar_url", mode="DEVELOPMENT", app_name="MyApp")
# Sending an error log with traceback
logger.send(show_traceback=True, error_message="Critical error occurred!", log_level=5)
# Sending an information log
logger.send(show_traceback=False, error_message="Operation successful.", log_level=2)
Thank you for considering supporting the project! Your help is greatly appreciated and it enables me to continue developing and maintaining the software.
Commit your work to the LORD, and your plans will succeed. Proverbs 16: 3
FAQs
The Logging Discord is a tool that simplifies the logging of error messages to a Discord channel. It allows you to send error messages with custom information, including a traceback and specific messages
We found that logging-discord demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.