Saravanan666/pypi-org huggingface dataset:
Package: logging42
A configuration for the loguru (https://github.com/Delgan/loguru) logger.It is important that it be the first import to run so the standard logging basicConfig method has an effect.FeaturesStderr outputintercepted logging from client librariesDisabled better exceptions for log levels above debug to mitigate secret leakingConfiguration retriever which safely logs retrieved valuesInstallationpipinstalllogging42Examplesmain.pyfromlogging42importloggerlogger.debug('hello world)
Package: logging518
🪵 logging518Use your pyproject.toml (or any other TOML file) to configure Python's native logging moduleUsageYou can uselogging518.config.fileConfigthe same way you would uselogging.config.fileConfigbut instead of passing a ConfigParser-form file, you can pass in a TOML-form file.importloggingimportlogging518.config# instead of logging.configlogging518.config.fileConfig("pyproject.toml")logger=logging.get_logger("project")logger.info("Hello, log!")Configurelogging518.config.fileConfigsimply deserializes the TOML file you pass in (usingtomli/tomlib) and passes the contents tologging.config.dictConfig.logging518.config.fileConfiguses thetool tablein your TOML file to look up the configuration. All logging config should be defined undertool.loggingin the tool table.[tool.logging]version=1disable_existing_loggers=true[tool.logging.loggers.project]level="WARNING"[tool.logging.loggers.project.foo_module]level="DEBUG"This config would be the same as:importlogging.configLOGGING_CONFIG={"version":1,"disable_existing_loggers":True,"loggers":{"project":{"level":"WARNING"},"project.foo_module":{"level":"DEBUG"}}}logging.config.dictConfig(LOGGING_CONFIG)More examples can be found in the 👩‍🍳Cookbook
Package: logging-actions
logging-actionsFor easy configuration oflogging.Loggers withargparse.Actions.Use it like this:>>>fromlogging_actionsimportlog_level_action>>>fromargparseimportArgumentParser>>>importlogging>>>logger=logging.getLogger("foo")# Create your script's logger>>>logger.addHandler(logging.StreamHandler())# Don't forget to add a handler!>>>parser=ArgumentParser()>>>_=parser.add_argument("--log-level",action=log_level_action(logger))# create an action for your module's logger>>>args=parser.parse_args()# Your logger's level will be set for you when parsingFeaturesChoices are handled transparentlyfoo.py --help

usage: foo.py [-h] [--log-level {critical,fatal,error,warn,warning,info,debug,notset}]

optional arguments:
  -h, --help            show this help message and exit
  --log-level {critical,fatal,error,warn,warning,info,debug,notset}
                        Set the logging level for foo.If you specify a default the log-level will be set accordinglyparser.add_argument("-l","--log-level",action=log_level_action(logger),default="info")Custom levels are supportedlogging.addLevelName(5,"TRACE")parser.add_argument("-l",action=log_level_action(logger),default="trace")BenefitsA better logging patternThis replaces the following pattern for setting script log levelsfromargparseimportArgumentParserparser=ArgumentParser()parser.add_argument("--log-level",default=logging.INFO,type=lambdax:getattr(logging,x)),help="Configure the logging level.",)args=parser.parse_args()logging.basicConfig(level=args.log_level)Manage multiple loggers easilyparser.add_argment("--foo-log-level",action=log_level_action(foo_logger))parser.add_argment("--bar-log-level",action=log_level_action(bar_logger))
Package: logging_addons
Why any alternative or add-on to the standard logging lib?While the std lib provides the essential need, there are situations where you do not get what you might expect. Or, the more you use logging, the more you want to get rid of some boiler-plate.This package provides e.g. an alternative log propagation along the logger tree, or an easy way to define filters in the config.See theProject Documentationfor details.
Package: logging-aws-sqs
logging_aws_sqsPython module for sending events to AWS SQSInstallationpipinstalllogging_aws_sqsFeaturesLog message to AWS SQS (Simple Queue Service) directly.All messages are send as as is it by default. If no time is available in events, current timestamp is used.Sample Codeimportloggingfromtimeimportsleepfromlogging_aws_sqsimportAWSSQSHandlerlogger=logging.getLogger('AWSSQSHandler')logger.setLevel(logging.DEBUG)queue="testqueue"aws_key_id="XXXXXXXXXXXXXXXXXXX"aws_secret_key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"region="us-east-1"sqs_handler=AWSSQSHandler(queue,aws_key_id,aws_secret_key,region)logger.addHandler(sqs_handler)foriinrange(1,3):dict_obj={'message':{'eventnumber':i,'api_endpoint':'test_endpoint'},'user':'abhinav','app':'my demo app','severity':'low'}logger.info(dict_obj)logger.warning("This is sample warning messages")logger.error("ERROR!! This is sample ERROR message")logger.debug("DEBUG!!, Sample Debug Message")sleep(5)
Package: logging-basic-config
Basic Python Logging ConfigurationThis is a Python pip package that provides a simple function calledconfig()that sets up the logging configuration for a Python project.How it WorksTheconfig()function takes in three optional arguments:logging_level,libs_to_silence, andenv_var_hide_timestamp.logging_levelspecifies the minimum logging level that should be recorded. The default value is "INFO".libs_to_silenceis a list of external libraries whose logging should be silenced. By default, several commonly used libraries are silenced.env_var_hide_timestampis an environment variable that can be set to hide the timestamp in the log messages.The function then proceeds to set up the logging configuration based on the provided arguments. It first sets the logging level for external libraries tologging.ERROR.Next, it checks theLOGGING_LEVELenvironment variable and uses its value if it is set, otherwise it uses thelogging_levelargument.The log format is then set depending on whetherenv_var_hide_timestampis set or not. If it is set, the format only includes the log level, filename, and line number. Otherwise, the format includes the timestamp, log level, filename, and line number.Finally, the function creates aStreamHandlerthat logs to the standard output, sets the formatter to the log format, adds the handler to the logger, and sets the logging level to the specified level.The logger is then returned so that it can be used throughout the project to log messages at the specified level.Overall,logging_basic_configsimplifies the process of configuring logging in a Python project, making it easier to customize the logging level and format, and to silence external libraries.ExampleInstall packagepipinstalllogging-basic-configUsing the libraryimportlogging_basic_configlogging=logging_basic_config.config(logging_level="DEBUG")logging.debug("Debug message")logging.info("Info message")logging.warning("Warning message")logging.error("Error message")logging.critical("Critical message")In additional filesOnce thelogging_basic_config.config(logging_level="DEBUG")code was called in yourmainor entrypoint call, you only need to importloggingand use it in other files.import logging

logging.info("This is another info message")
Package: logging-color-formatter
A colored logging formatter.Installationpip install logging-color-formatterUsage[loggers]keys=root[handlers]keys=console[formatters]keys=generic[logger_root]level=DEBUGhandlers=console[handler_console]class=StreamHandlerargs=(sys.stdout,)level=NOTSETformatter=generic[formatters]keys=color[formatter_color]class=logging_color_formatter.ColorFormatterChangesSee [Github Releases](https://github.com/leplatrem/logging-color-formatter/releases)Run testspy.testLicenceApache License v2
Package: logging-colorizer
Installationyou can install the following library simply by just running:pip install logging-colorizerUsageIn addition to use this library first we need to import it using:fromlogging_colorizerimportLogafter that we instantiate our logger and we also can costumize its formatlog=Log()#this is the logger with its default settingslog=Log(format="%(light_black)sTIME:%(asctime)s%(cyan)s|%(light_black)sIP:%(clientip)s%(cyan)s|%(light_black)sCODE:%(Code)s%(cyan)s|%(purple)s[%(lvl)s]%(cyan)s|%(log_color)s%(message)s%(reset)s")# this is the logger with costumized format like soThe levels to trigger a logLevelDefault function nameAbbriviationShortened nameInfoinfoinfiwarningwarningwarnwdebugdebugdbgderrorerrorerrecriticalcriticalcritcSo all of three lines bellow do the exact same thinglog.info('Here is the info')log.inf('Here is the info')log.i('Here is the info')And so on...The colorsFor using different colors in your logger you should provide the color on the format argument of the module like this:log=Log(format="%(purple)s%(message)s%(reset)s")in the above example in every call of the logger, it writes the message in purple color and then resets the color for future logs.(just incase if there were no colors provided)instead of purple, you can use these colors:light_black, black, bold_blacklight_red, red, bold_redlight_green, green, bold_greenlight_yellow, yellow, bold_yellowlight_blue, blue, bold_bluelight_purple, purple, bold_purplelight_cyan, cyan, bold_cyanlight_white, white, bold_whiteExampleA boilerplate code can be like this:# Importsfromlogging_colorizerimportLogimportrequests# A function that gets the current IP addressdefcheck_ip():session=requests.session()ip=session.get("http://icanhazip.com").text.replace("\n","")session.close()returnipip=check_ip()# Run the function to get the iplog=Log(format="%(light_black)sTIME:%(asctime)s%(cyan)s|%(light_black)sIP:%(clientip)s%(cyan)s|%(light_black)sCODE:%(Code)s%(cyan)s|%(purple)s[%(lvl)s]%(cyan)s|%(log_color)s%(message)s%(reset)s")# Initializing our logging module with our custom formatlog.info('Here is an info log',extra_plus_ali={'clientip':ip,"Code":"Boilerplate.py"})log.warning('Here is a warning log',extra_plus_ali={'clientip':ip,"Code":"Boilerplate.py"})log.debug('Here is a debug log',extra_plus_ali={'clientip':ip,"Code":"Boilerplate.py"})log.error('Here is an error log',extra_plus_ali={'clientip':ip,"Code":"Boilerplate.py"})log.critical('Here is a critical log',extra_plus_ali={'clientip':ip,"Code":"Boilerplate.py"})Which is supposed to write the current time, ip, the code name in black color and the log level in purple and the message color is based on the log level.if the log level is info, the message color will be greenif the log level is warning, the message color will be yellowif the log level is debug, the message color will be whiteif the log level is error, the message color will be redif the log level is critical, the message color will be bold redWhich returns an output like bellow:
Package: loggingconf
Copyright (c) 2019 Keunhyun OhPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.Description: # loggingconf## DescriptionThis Module helps to load a configration file for logging module## Install```bashpip install -U loggingconf```## Example```pythonimport loggingconfloggingconf.file_config('logconf.ini')loggingconf.file_config('logconf.yaml')loggingconf.file_config('logconf.json')```## Python VersionsPython 2.7, 3.4, 3.5, 3.6, 3.7Platform: anyClassifier: Programming Language :: Python :: 3.4Classifier: Topic :: Software Development :: Libraries :: Python ModulesClassifier: Intended Audience :: DevelopersClassifier: Operating System :: MacOS :: MacOS XClassifier: Programming Language :: Python :: 2.7Classifier: Programming Language :: Python :: 3.7Classifier: Operating System :: Microsoft :: WindowsClassifier: Programming Language :: PythonClassifier: Programming Language :: Python :: 3.6Classifier: License :: OSI Approved :: MIT LicenseClassifier: Programming Language :: Python :: 3.5Classifier: Intended Audience :: Information TechnologyClassifier: Operating System :: POSIX :: LinuxRequires-Python: >=2.7
Package: logging-discord
Logging DiscordEnglishPortuguêsLogging Discordis 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.Table of ContentsHow to Install the Package?How to Use the Package?Configuration via 'discord_config.py'Usage ExamplesDonationsHow to Install the Package?pipinstalllogging_discordHow to Use the Package?Quick Start.fromlogging_discordimportLogDiscordlog_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 = criticalConfiguration withdiscord_config.pyYou can configure the parameters of theLogDiscordclass 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 = Red0:{'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},}Usage ExamplesHere are some examples of how to use theLogDiscordclass:# Creating a logger instancelogger=LogDiscord(webhook="your_webhook_url",avatar_url="avatar_url",mode="DEVELOPMENT",app_name="MyApp")# Sending an error log with tracebacklogger.send(show_traceback=True,error_message="Critical error occurred!",log_level=5)# Sending an information loglogger.send(show_traceback=False,error_message="Operation successful.",log_level=2)Remember to adjust the parameters according to your needs and customize error messages as necessary.DonationsThank you for considering supporting the project! Your help is greatly appreciated and it enables me to continue developing and maintaining the software.Support the ProjectCommit your work to the LORD, and your plans will succeed. Proverbs 16: 3
Package: logging-dlt
logging-dltDocumentationDLT Autosar SpecificationA python logging adapter for "diagnostic log and trace" protocol.DescriptionThe goal of this project is to provide a way to route the proprietary dlt
protocol into the python logging framework. This is done by using a logging adapter
together with a dlt stream parser.DLT protocolDLT (Diagnostic Log and Trace) is a proprietary logging protocol.
It is used in debugging automotive ECUs that run Autosar OS.You should NOT use it if you have the choice!It has many traps, inconsistencies and architecture dependencies.
In the field it does overflow its own stream buffer, corrupting data on the wire.
It causes endianess problems, e.g. use big endian even if it announced little endian
a few bytes before (Proof 1,2) etc.It is clear that it did not compete against any other logging mechanism or had any trial phase.
It was just forged into a standard that is enforced for the Autosar OS.LicenseThis software is distributed under GPLv3 with some extension because GPLv3 did not manage to deny
criminal misuse by organizations.
This software is intended for usage by community and private individuals who are interested in car hacking.
It is explicitly denied that any company or organization monetizes on this software. Monetize does not only mean money,
it means gaining a competitive advantage of any kind by using this software.
The author explicitly denies the usage for people associated with military,
government agencies of any kind to whatever degree, same for car manufacturers and associates.Deprecation of PyPi PackagesPackages on PyPi are no longer updated due to attempts of the Python Software Foundation to enforce new rules and basically flush out
developers who do not consent.Recent packages can be installed directly from git, i.e.pip install git+https://gitlab.com/menschel/logging-dlt.git --upgrade
Package: loggingex
Implements a few extensions for the standard python logging library.Currently, this project lacks documentation. Sorry about that.Logging Context FilterLogging Context Filter injects context variables into LogRecord objects as extra
fields.Here’s a usage example:importloggingimportsysfromloggingex.contextimportLoggingContextFilter,contextlog=logging.getLogger()defprocess_lines(lines):forindex,lineinenumerate(lines):line=line.strip()withcontext(current_line=index+1):log.debug("processing line:%s",line)ifnotline:log.error("empty line!")continuelog.info("processed line:%s",line)defprocess_files(filenames):log.debug("starting...")forfilenameinfilenames:withcontext(current_file=filename):log.info("processing file:%s",filename)withopen(filename,"r")asf:process_lines(f)log.info("processed file:%s",filename)log.debug("work is complete!")if__name__=="__main__":formatter=logging.Formatter("%(current_file)s:%(current_line)s:%(levelname)s:%(message)s")handler=logging.StreamHandler(stream=sys.stdout)handler.setFormatter(formatter)handler.setLevel(logging.DEBUG)handler.addFilter(LoggingContextFilter())# it's that simplelogging.basicConfig(handlers=[handler],level=logging.DEBUG)withcontext(current_file="-",current_line="-"):# The context above sets default value, so that the formatter does# not crash, when they are not defined.process_files(sys.argv[1:])
Package: logging-ext
logging-extlogging extension;installpip install logging-extlicenseCopyright (C) 2018 Cyker WayThis program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.You should have received a copy of the GNU General Public License along with
this program.  If not, seehttps://www.gnu.org/licenses/.
Package: loggingextras
# pyLoggingExtrasExtra logging functionality for Python####NoneLoggerNoneLogger is a logger class that implements logging.Logger interfacebut provides no functionality (Null object design pattern), allowing youto use that as a default logger and forgo the need to check if logger isan actual instance before using it to log things.**Example:***without NoneLogger*```pythondef method_that_logs_if_possible(arg1, arg2, logger=None)#TODO code hereif logger:logger.info("ran code up to here")#TODO more code hereif logger:logger.debug("values here are so and so")```*with NoneLogger*```pythonfrom loggingextras import NoneLoggerdef method_that_logs_if_possible(arg1, arg2, logger=NoneLogger())#TODO code herelogger.info("ran code up to here")#TODO more code herelogger.debug("values here are so and so")```####API Loggingapilog is a set of logging decorators that will log entry and exit eventsin and out of methods.apilog decorators will log entry events and input arguments to methods, aswell as exit values and exceptions raised within methodsapilog decorators are availale for different logging levelsapilog decorators take advantage of a class's logger property if oneexists and follows logging.Logger interface. otherwise uses stdout printsapilog decorators are available for the following logging levels:```pythonapilog_finestapilog_finerapilog_fineapilog_debugapilog_infoapilog_warningapilog_errorapilog_critical```**Example usage module level methods:**```pythonfrom loggingextras.apilog import apilog_debug, apilog_info@apilog_debugdef method_debug_output(param_a=None):print 'params:', param_areturn param_aif __name__ == "__main__":method_debug_output(dict(k1=1, k2=2))```*Sample output:*```DEBUG:apilog:entering method_debug_output with wargs=[{"k2": 2, "k1": 1}], kwargs={}params: {'k2': 2, 'k1': 1}DEBUG:apilog:exiting method_debug_output with {"k2": 2, "k1": 1} in [0:00:00.000107]```**Example usage using class methods with a class logger availble:**```pythonfrom loggingextras.apilog import apilog_debugclass decorated_class_with_logger(object):def __init__(self):basicConfig(level=1, stream=sys.stdout)self.logger = getLogger('decorated_class')@apilog_debugdef method_a(self, param_a=None, param_b=None, param_c=None):self.logger.info('params:', param_a, param_b, param_c)assert param_b != "exception", 'failed something'if __name__ == "__main__":obj = decorated_class_with_logger()obj.method_a(param_b='something')```*Sample output:*```DEBUG: decorated_class: entering method_a with wargs=[], kwargs={"param_b": "something"}INFO : decorated_class: params: None something NoneDEBUG: decorated_class: exiting method_a with null in [0:00:00.000090]```