Skip to main content

Create logs on Discord, Telegram or a local file

Project description

Logger

A Python Module to create logs on Discord, Telegram or a local file

Installation

Either

pip install Logger-Zuj3brusu

Or

pip install git+git://github.com/Zuj3brusu/Logger.git

Usage

Initialization

from Logger import logger

# Creating a Logger object
loggerObject = logger.Logger()

Initialize Discord Logger (Optional / Only needed to send Discord Logs)

One way to do this is to directly set the values of DcUrl and DcBotName while initializing the logger. Another way to do this is

# Set the values of Discord Webhook url and Bot Name
loggerObject.setDiscord(DcUrl = <Channel Webhook>, DcBotName = <Name of the Bot>)

# Start the Discord Logger
loggerObject.startDiscordLogger()

Initialize Telegram Logger (Optional / Only needed to send Telegram Logs)

One way to do this is to directly set the values of TgChatID and TgbotAPI while initializing the logger. Another way to do this is

# Set the values of Telegram Chat ID and Bot API
loggerObject.setTelegram(TgChatID = <Chat ID>, TgbotAPI = <Bot API>)

# Start the Telegram Logger
loggerObject.startDiscordLogger()

Initialize FileLogger

While the FileLogger is initialized by default, you can still change any/all of the parameters. One way to do this is to directly set the values of FileLogger parameters while initializing the logger. Another way to do this is

# Set the values of Telegram Chat ID and Bot API
loggerObject.setFileLogger(
	LogFolderLocation = <LogFolderLocation>,
	LogFileName       = <LogFileName>,
	LogFileMode       = <LogFileMode>,
	LogFormat         = <LogFormat>,
	LogLevel          = <LogLevel>
	)

# Start the FileLogger
loggerObject.startFileLogger()

Sending a log

Logs can be sent using any/all Logger(s). You just need to set the values of parameters to True for the Loggers for which you want to send the logs.

print Determines whether to print success or error messages.

log="Hello World"

loggerObject.send(log,discord=True,telegram=True,filelogs=True,print=True)

Thanks for checking it out!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Logger-Zuj3brusu-2.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Logger_Zuj3brusu-2.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file Logger-Zuj3brusu-2.0.tar.gz.

File metadata

  • Download URL: Logger-Zuj3brusu-2.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for Logger-Zuj3brusu-2.0.tar.gz
Algorithm Hash digest
SHA256 a9048cd2f0c9127da9b4467d07f40edd3bb3f379446c8c5cfdbf18f0459f4251
MD5 f3e20d51f0e977125dd26ee5ced18171
BLAKE2b-256 74ce658bfa401990e1bb7b4a41a3476b188fb007c2c766c00880e76cc49568d7

See more details on using hashes here.

File details

Details for the file Logger_Zuj3brusu-2.0-py3-none-any.whl.

File metadata

  • Download URL: Logger_Zuj3brusu-2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for Logger_Zuj3brusu-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ca6f9e2ce6ab7d0b4046ab6d620d1b4aa4b5388892d14578ade4f8a1f1458a6
MD5 27a48371dfd6171c5b0ee122aefa77b9
BLAKE2b-256 88a17fc3024cf0b6308d6ad13dc8e6a6d11c5cb8884afead1fa533ca2f7ce99b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page