Saravanan666/pypi-org huggingface dataset:
Package: logger-color
logger-colorDifferent logging levels for stram (terminal) and file. Color the log messages.
Has additional levels for diagnostics: DIAG_INFO, DIAG_WARNING.LevelIntColorDEBUG10grayINFO20greenWARNING30yellowERROR40redCRITICAL50bold redDIAG_INFO21blueDIAG_WARNING31blue boldContentsRequirementsInstallationstart_logging()Parametersdebug()diag_info()diag_warning()info()warning()error()critical()RequirementsPython >=3.8InstallationInstall the package from pypi.org releasepipinstalllogger-coloror install the package from github.com repositorypipinstallgit+https://github.com/vladimirs-git/logger-coloror install the package from github.com releasepipinstallhttps://github.com/vladimirs-git/logger-color/archive/refs/tags/0.0.8.tar.gzstart_logging()start_logging(filename, mode, level, level_file, color, debug)- Start logging
with the specified parametersParametersParameterTypeDefaultDescriptionfilenamestrWrites messages to this file. By default, logging only to the terminalmodestr“w”“w” - Writes to file (default), “a” - Appends to filelevelstrINFOLogging level for the terminal: “DEBUG”, “INFO” (default), “WARNING”, “ERROR”, “CRITICAL”, “DIAG_INFO”, “DIAG_WARNING”level_filestrlevelLogging level for the file. By default, the same aslevelparametercolorboolTrueTrue  - Prints a colored message to the terminal (default), False - Prints a monochrome message to the terminaldebugboolFalseTrue  - Sets logging level to DEBUG (rewriteslevelparameter), works the same as level=”DEBUG”. False - Gets logging level fromlevelparameter (default)debug()debug(args, kwargs)- Log a message with severity “DEBUG”diag_info()diag_info(msg, args, kwargs)- Log diagnostic message with severity “INFO”diag_warning()diag_warning(msg, args, kwargs)- Log diagnostic message with severity “WARNING”info()info(args, kwargs)- Log a message with severity “INFO”warning()warning(args, kwargs)- Log a message with severity “WARNING”error()error(args, kwargs)- Log a message with severity “ERROR”critical()warning(args, kwargs)- Log a message with severity “CRITICAL”Exampleimportlogger_colorlogger_color.start_logging(filename="/var/log/test.log",level="debug",level_file="error")logger_color.debug("debug")logger_color.info("info")logger_color.warning("warning")logger_color.error("error")logger_color.critical("critical")logger_color.diag_info("diag_info")logger_color.diag_warning("diag_warning")# 2000-12-31 23:59:59.474 DEBUG    messages.debug: debug# 2000-12-31 23:59:59.474 INFO     messages.info: info# 2000-12-31 23:59:59.474 WARNING  messages.warning: warning# 2000-12-31 23:59:59.474 ERROR    messages.error: error# 2000-12-31 23:59:59.474 CRITICAL messages.critical: critical# 2000-12-31 23:59:59.474 DIAG_I   messages.<module>: diag_info# 2000-12-31 23:59:59.474 DIAG_W   messages.<module>: diag_warning# cat /var/log/test.log# 2000-12-31 23:59:59 ERROR    error# 2000-12-31 23:59:59 CRITICAL critical
Package: logger-config
logger-config: Configurable and flexible logger for your python applicationsDescriptionThelogger-configpackage is a basic configurable logger. This package is currently tested on Python =< 2.7.
This  package worked on multithreding modeInstallationpip install logger-configordownload thelatest release_ and runpython setup.py installUsageimport logging

from logger_config import configure_logging

logger_name = 'root_logger'
configure_logging(logger_name, log_dir='logs', log_level=logging.DEBUG)
logger = logging.getLogger(logger_name)


logger.warning('This is warning')
logger.error('This is exception')
logger.info('This is info message')
logger.debug('This is debug message')Console Output[2022-01-07 22:41:52,153] [MainThread] [WARNING] This is warning
[2022-01-07 22:41:52,153] [MainThread] [ERROR] This is exception
[2022-01-07 22:41:52,153] [MainThread] [INFO] This is info message
Package: logger-decorator
Logger DecoratorLogger Decorator can log sync/async/yield (sync/async) functions. 

Can pass unique request id for all functions to have possibility ease find in your log all operations by filtering request_id.

Use as simple python decorator

if you need alerting to slack you can use @LoggerDecorator intead of @logger_decorator
@LoggerDecorator(
    event_type='main_func',
    full_trace=True,
    webhook_url=<you_url>',
    entry=True,
    notification_slack=True
    )Getting started1. pip install logger_decorator
1.1 import: from logger_decorator import logger_decorator
1.2 If function return yield need to pass yield_=True
1.3 Decorator need to be placed last
1.4 To generate unique request_id  you need use  middlewareExample middleware usage (Fast Api)@app.middleware("http")
    async def log_request(request: Request, call_next):
        set_request_id() # to create unique request_id
        response: responses.StreamingResponse = await call_next(request)
        return responseUsage with Threads to pass request_id1. To pass request_id use <kwargs> kwargs = {'request_id': get_request_id_()}To use with Celery and pass request_id from your app to celerycelery_task.apply_async(args=(ar,), kwargs={'request_id': get_request_id_()})Usage with celery Beatcelery.conf.beat_schedule = {
           'call-every-10-seconds': {
           'task': 'my_schedule_task',
           'schedule': 10.0, #time-interval type
       }
    
       @logger_decorator(event_type='task1')
       def task1(*args, **kwargs):
           pass
    
       @logger_decorator(event_type='task2')
       def task2(*args, **kwargs):
           pass
    

    @celery.task(name='my_schedule_task') 
    def my_schedule_task(*args, **kwargs):
        set_request_id() # create request_id
        task1(request_id=get_request_id_())
        task2(request_id=get_request_id_())Usage with Django<middlewary.py>
from logger_decorator import set_request_id

class MyMiddleware:
    def __init__(self, get_response):
        set_request_id() # initializations request_id
        self._get_response = get_response

    def __call__(self, request):
        response = self._get_response(request)
        set_request_id() # initializations request_id
        return response

<serializers.py>
from rest_framework import serializers
from main.models import Book
from logger_decorator import logger_decorator

@logger_decorator(event_type='helper_func')
def helper_func():
    return 'ok'


class BookModelSerializer(serializers.ModelSerializer):

    title = serializers.SerializerMethodField()

    @logger_decorator(event_type='get_title')
    def get_title(self, obj):
        helper_func()
        return obj.title

    class Meta:
        model = Book
        fields = '__all__'
Package: logger-es-cli
logger-es-cliCLI for sending logging to elasticsearch (alpha version)How to build packageneeds to have poetry installed.sudopython3-mpipinstallpoetryoptionalsudoyuminstallredhat-rpm-configgcclibffi-develpython3-developenssl-develcargo
sudopython3-mpipinstallpython-dotenv[cli]run build commandpoetrybuildAccess AWS ES with VPC access using a tunning sshopen a terminal and issue the following command:ssh-L9200:vpc-kibana-dashboard-maneiro-brbrhuehue.sa-east-1.es.amazonaws.com:443-i~/.ssh/your-private-key.pemec2-user@5.6.7.8now try to send logs to elasticsearch.env file env variablesexample:# kibana ip or dnsKIBANA_SERVER=localhost# use SSLKIBANA_SSL=true# exclude default args from kibana# if true exclude those following args:# pathname,exc_info,exc_text,thread,threadName,stack_info,filename,processName,process,args,msg,name,levelnameEXCLUDE_DEFAULT=true# kibana server portKIBANA_SERVER_PORT=9200# kibana usernameKIBANA_USERNAME=robots.logger# kibana passwordKIBANA_PASSWORD=fd89078C-2e8e-4549-b9de-B9955123a0e3# software environmentENVIRONMENT=DEVELOPMENT# project name that is the same index name in elastic searchPROJECT_NAME=gmf-tech-modulex# exclude args to send to elasticsearchEXCLUDE=thread,threadName,processName# a custom json file , to append when send logs to elasticsearchCUSTOM_FILE=/run/media/gustavo/backup/git-projects/logger-es-cli/custom.json# unbuffer sysout pythonPYTHONUNBUFFERED=true# send debug logs to es?SEND_DEBUG=falsecustom.json fileexample:{"username":"gustavo@gmf-tech.com","account":"system"}poetry export dependenciespoetryexport-frequirements.txt--outputrequirements.txtrun logger-es-cli with a .env file [dotenv dependence]dotenvrun--logger-es-cliinfo'alo mundo louco!!!'Do not forget to issue command message with single quote. In bash if you send with double quotes, escape caracters will broken the CLILicenseThis project is licensed under the terms of the MIT license.
Package: loggerFactory
Welcome tologgerFactoryDocumentationConstructStream HandlerandFile Handleris so boring.loggerFactoryinclude some commonly used logger out-of-the-box. You can create a super easy to use logger inminimal code.Example:importloggerFactory# log to consolelogger=loggerFactory.StreamOnlyLogger(rand_name=True)logger.warning("Some thing wrong!")# log to file# if name is not specified, a random name will be assignedlogger=loggerFactory.SingleFileLogger(path="log.txt")logger.error("Fatal Error!")# file rotatinglogger=loggerFactory.FileRotatingLogger(path="log.txt")# time rotatinglogger=loggerFactory.TimeRotatingLogger(path="log.txt")Use color and indent to format your print:importloggerFactorylogger=loggerFactory.BaseLogger()logger.show_in_red("Hello",indent=0)logger.show_in_blue("Hello",indent=1)logger.show_in_yellow("Hello",indent=2)logger.show_in_green("Hello",indent=3)logger.show_in_cyan("Hello",indent=4)logger.show_in_meganta("Hello",indent=5)If you are using default log format%(asctime)s;%(levelname)-8s;%(message)s, alogfiltercan help you search log info.Example:fromloggerFactoryimportfindresult=find("log.txt",level="debug",message="ValueError",time_lower=None,time_upper=None,case_sensitive=False,)result.dump("result.txt")print(result)InstallloggerFactoryis released on PyPI, so all you need is:$pipinstallloggerFactoryTo upgrade to latest version:$pipinstall--upgradeloggerFactory
Package: logger-generate
logger_generate生成 logger 用的，清涼舒爽開箱即用的 logger。A python packageeasy to generate logger.Installpippipinstall-Ulogger-generatepoetrypoetryaddlogger-generateExamplefromconfigimportbasefromlogger_generateimportgeneratelogger=generate()logger.info("引入即用 ( •̀ ω •́ )✧")logger_config={"logging_level":'DEBUG',"log_file_path":'./logs/by_logger_config.log',"log_format":'%(asctime)s-%(levelname)s:%(message)s',"backupCount":7,"when":'D',"encoding":'utf-8',}logger=generate(logger_config,name='from_dict')logger.info("亦可用程式內 dict 設定")logger=generate(base.logger_config(),"from_config_file")logger.info("也以用從檔案引入 config")logger=generate(logger_config,name='方便生成隨機log名稱',need_serial=True)logger.info("←後方隨機5字元")logger=generate(base.logger_config(),"ex",True)logger.info("示範單純用位置作為輸入手段")logger=generate(logging_level='DEBUG',name='use_kwargs',log_file_path='./logs/use_kwargs.log')logger.info("現在也可以用 kwargs 設定 logger")
Package: loggerhead
OverviewLoggerhead is a web viewer for Breezy. Its lets users do stuff like:navigate through branch historyview the files in a given revisionannotate files (i.e. find out the origin of each line of a file)perform searches.DocumentationSee docs/index.rst for installation instructions and basic
documentation.LicensingThis software is licensed under the GPL Version 2 or later.
Please see the file COPYING.txt for the licence details.(C) Copyright Canonical Limited 2006-10
(C) Copyright Breezy Developers 2018
Package: logger-helper
Documentation build, testing and linting for themasterbranch.Logger HelperLogger Helper provides a simple way to gather verbose logs within your
application. Set up your logging using the standardlogginglibrary and
decorate your classes, methods and functions (or even do it at the module level
with themodmethod) to get detailed logs of what your application is
doing:Calling __main__.Test.add(a = 1, b = 2, c = 3)
Returned 6 from __main__.Test.add
Calling __main__.Test.subtract(a = 3, b = 2, c = 2)
Returned -1 from __main__.Test.subtract
Calling __main__.Test.divide_by_zero(a = 10)
Exception ZeroDivisionError occurred, "division by zero"InstallationTo install the Logger Helper package, ensure you have pip installed using your
distributions package manager and then run the following command:pipinstalllogger-helperBasic UsageYou can start using theLoggerHelperright away.importloggingfromlogger_helperimportLoggerHelper# Perform your standard logging setup herelog=LoggerHelper(logging.getLogger(__name__),logging.DEBUG)# DONE! Start decorating your modules, classes and functions:@logclassMyClass:defmethod_1(self):passdefmethod_2(self):pass@logdeffunction():passFor more information, be sure to readthe documentation. If you clone this
repository and installinvoke, you can serve the documentation locally withinvokeserve-docs.
Package: logger-henryriveracs
loggerAn easy-to-use logger class built using python3's nativeloggerlibrary. It can intelligently handle pushing stdout messages between files/terminals based off configured options. Extremely useful for setting up a wholelogger.Logging()instance without worrying about configuring format/file-handling for scripts/applications.FeaturesHas a built-in logging style: [DATE TIME] [LEVEL] [LOG NAME] [LOG COUNT] - [MESSAGE]supports python's built-inwith()statementCan figure out whether to log a specific message to a file or log based off the Level configured such as:Level 0/None - Log everything to the terminal.Level 1 - Log critical to file. Log warnings/ok/info to terminal.Level 2 - Log critical/error to file. Log warnings/info/ok to terminal.Level 3 - Log errors/warnings to file. Log INFO/OK  the terminalLevel 4 - Log everything into fileDynamically switch log levels and logging files withset_log_file()andset_log_level()respectively.Enable/Disable logging as needed.Installation(Requires python >= 3.10)pip3 install logger-henryriveracs==0.3.0OR copysrc/logger/logger.pyinto your repository.Usage#python3fromlogger.loggerimportLogitems=["item1","item2","item3","item4","item5"]my_logger=Log(Name="My Logger")my_logger.info(items[0])my_logger.ok(items[1])my_logger.warning(items[2])my_logger.error(items[3])my_logger.critical(items[4])# pointing logger to example.log with log level set to 2my_logger.set_log_file("example.log")my_logger.set_log_level(2)my_logger.ok("Test OK")my_logger.error("Test Error")Results from running example.py under theexample/folderTerminal:File:
Package: loggerholder
logger holder>>>importlogging>>>importos>>>SELFDIR=os.path.dirname(os.path.abspath('.'))# or : SELFDIR = os.path.dirname(os.path.abspath(__file__))>>>PROJECTDIR=os.path.dirname(SELFDIR)>>>>>>fromloggerholderimportLoggerHolder>>>logargs=('logs/app.log','h','%(asctime)s%(process)d%(thread)d%(levelname)s:%(message)s',logging.DEBUG,PROJECTDIR)>>>logger=LoggerHolder.holded(logargs)>>>print(logger)>>>
Package: loggerjava
loggerjavaan easy logger outputs like java logsHow to useimportloggerjavalogger=loggerjavalogger.info("test")logger.warn("test",pos="insidecommand")Outputs[20:39:00] [main/debug]: test
[20:39:00] [main/info]: test
[20:39:00] [main/WARNING]: test
[20:39:00] [main/ERROR]: test
[20:39:00] [main/FATAL]: testDeveloping featuresmutiple variable with different configsnew config formatConfigimportloggerjavaloggerjava.config(**kwargs)""":param kwargs:input config names and config dataformat: config_name = config_databelow are config_name and the descriptionname : change the name of the log file, only actives when abolutepath config is offfiletype : change the file type of the log file, only actives when abolutepath config is offabsolutepath : change whether inputing the absolute path of the log file,True for using the name and filetype to create file in the program running locationFalse for using the route to create file in the specific location(note:you need to enter the file format,like:test.log)route : change the file location, only activates when abolutepath config is onfile_encoding : change the file encoding methodshowdetailedtime : whether to show detailed time in the log fileshowinconsole : whether to show the log in the python console:return:"""usinglogger.exportconfig()to export your current configand usinglogger.inportconfig(inputconfig)to inport your configVersionsv0.0.7.1adding debug config,adding debugv0.0.7no actual updates, updating version num to ver x.x.x0.0.6.1update readme0.0.6change the config method, adding file_encoding,absolutepath,filetype config0.0.5.1rename outputconfig -> exportconfig0.0.5added the outputconfig and the loadconfig function,edited the config part to let it output log0.0.4upgrade the config sys and add helps0.0.3upload the descriptions0.0.2initial upload
Package: logger-json
#logger_adacore packageA very basic Python package provides a subclass of logging.Formatter.Subclass JSONFormatter is capable to log a string or an ordered dict.The only possible JSON format is as following for this version of the package:
{
"asctime": "2020-04-26 20:26:38,471",
"levelname": "INFO",
"msg": "testing logging format"
}
Package: logger-loco
Logger LOCOLoCo = log via commentsPython >= 3.6 onlyUsage:importloggingfromlogger_locoimportlocologger=logging.getLogger('mylogger')@loco(logger)defsomefunc(a,b):# This is a regular commentc=a+b#@ This is debug#- This is info#! This is warning#X This is error#@ You could also use variables interpolation: {a} + {b} = {c}#-->#@ This is indented log#-->#@ This is deeper indented log#<--#<--#@ This is not indented logsomefunc(1,2)@loco(logger)classSomeclass(object):defmymethod(self):#@ Also works with classespassSomeclass().mymethod()Will print:DEBUG: This is debug
INFO: This is info
WARNING: This is warning
ERROR: This is error
DEBUG: You could also use variables interpolation: 1 + 2 = 3
DEBUG:   This is indented log
DEBUG:     This is deeper indented log
DEBUG: This is not indented log
DEBUG: Also works with classesDevelopmentDeploy package to <test.pypi.org>:python3 setup.py sdist
python3 -m twine upload ---repository-url https://test.pypi.org/legacy/ dist/*Deploy package to <pypi.org>:rm -rf dist/
python3 setup.py sdist
python3 -m twine upload dist/*
Package: loggermodule-X
Logger Module XJust logging python file !Change log !!!Version 2.1Build project as wheel !Rotate log by folder name as default (Rotated by date)Now you can manual config log split by send parameter 'maxBytes' and 'backupCount' !Remove unused parameters.InstallationUse the package managerpipto install loggermodule-X.pipinstallloggermodule-Xorpipinstallloggermodule-X-UUsagefile= requiredhstdout = [optional] logging to STDOUT console (Default is 'DEBUG') make sure option is in this list = ['NOTSET', 'INFO', 'DEBUG', 'ERROR', 'WARNING', 'CRITICAL']hfile = [optional] logging to File (Default is 'DEBUG') make sure option is in this list = ['NOTSET', 'INFO', 'DEBUG', 'ERROR', 'WARNING', 'CRITICAL']maxBytes = [optional] int (Default is 0)backupCount= [optional] int (Default is 0) if maxBytes > 0 this param should not be 0 !!!!!!!!fromloggermodule_Ximportlogger_xif__name__=='__main__':log=logger_x(__file__).configLogger()log.info('THIS is info msg !!')log.debug('THIS is debug msg !!')log.error('THIS is error msg !!')log.warning('THIS is warning msg !!')log.critical('THIS is critical msg !!')LicenseDataxet Limited
Package: loggerpy
loggerpyThe simplest Python logger for everyday tasks.Table of ContentsInstallationInstructionsConfigurationLoggerCustomizationLogger RecoveryVersionNext featuresLicenseInstallationThe easiest way to install is throw pip.pipinstallloggerpyInstructionsIn order to use this simple logger, many examples are provided insideexamples directoryConfigurationThe main classes of theloggerpypackage areLoggerandLevel.fromloggerpyimportLogger,LevelTheLoggerclass is aSingleton, so you can recall the__init__method throughLogger()and the same instance will always be returned.logger=Logger()The possible customization of the logger instance are:name: the name of all loggersfolder: the path of saving log if you want to save themprint_level: the minimum level of printingsave_level: the minimum level of saving, they can be differentIn order to simplify the customization of printing and saving level it is provided a class that contained the 6 possible levels of logging.
ImportingLevelfrom loggerpy, they can be used eg Level.DEBUG or Level.WARNINGLevel.NO_LOGGERLevel.DEBUGLevel.INFOLevel.WARNINGLevel.ERRORLevel.CRITICALThepathcan be set as absolute or relative.
If the path is an absolute path it is used directly, otherwise it put after the project path. The default value is the project pathE.g.
 Relative path
 -------------
 >>> logger.folder = 'relative_path'
 In this case the used path is:
 > /path/to/the/project/relative_path

 Absolute path
 -------------
 >>> logger.folder = 'absolute_path'
 It is setted as global path
 > /absolute_path/ConfigurationexampleLoggerNow, it's time to create your first logger.fromloggerpyimportLoggerlogger=Logger()logger.name="First logger"First loggerexampleCustomizationThe parameters of the Logger class can be set all in one time.logger.configure(name="Name",log_folder="path/to/log/folder",print_level=Level.DEBUG,save_level=LEVEL.WARNING)AnexampleVersionsstable version1.0 :first release1.1 :rewritten the input path of saving log inconfigure()andget_logger()configuration works properly for all file of your project2.0 :Logger is now a SingletonLevel is an enumNextFeaturescustomformatfor timestampcustomformatfor all logcustomcolorfor each levelLicenseThis project is under the GPL-3.0 license - see theLICENSE.mdfile for more details
Package: loggerpyth
LoggerLogger is a Python package that makes logging easyInstallationpipinstallloggerpythGet StartedInfo, Warning, SuccessEvery method takes in an area, a message and an option loc which represents the current line of code, it can be got by using 'Logger.line()' or by passing an integerfromLogger.LoggerimportLoggerLogger.info(area='Main',message='This is an info',loc=Logger.line())Logger.warning(area='Main',message='This is a warning',loc=Logger.line())Logger.success(area='Main',message='This is a success',loc=Logger.line())OutputErrorThe error method provides an exception that can be passed by the user with a message or it will be the default 'Exception' raised with an empty stringdefaultLogger.error(area='Main',message='Error',loc=Logger.line())custom errorLogger.error(area='Main',message='Error',error=Logger.Err(ValueError,'msg'),loc=Logger.line())You can also perform and check operation (of two types)OperationIt will be 'raised' a success if the operation goes as it should, a warning otherwiseLogger.operation(name='Sum',result=2+2,expected_result=5)Logger.operation(name='Sum',result=2+2,expected_result=4)DebugIt will be 'raised' a success if the operation goes as it should, an error otherwiseLogger.debug(name='Sum',result=2+2,expected_result=5,error=Logger.Err(ValueError,'msg'))Logger.debug(name='Sum',result=2+2,expected_result=4,error=Logger.Err(ValueError,'msg'))Github:https://github.com/Bilodev/
Package: loggerr
loggerrZero configuration JSON logger(r)fromloggerrimportLoggerrlogger=Loggerr("warn")logger.info("Something going as expected",{"host":socket.gethostname()})# ignoredlogger.warn("Something must have gone terribly wrong")# sentexceptExceptionase:logger.error(e,{request:"this was the request"})Log levelCreate logger instance with a minimal log levelLog levels are (respectively):debugverboseinfowarnerrorcriticalFor example, a logger with log level "warn" will only print logs with level "warn", "error", or "critical".SynonymsA couple of function synonyms have been placed to your convenience:functionwill log with levellogger.log(...)"info"logger.warning(...)"warn"logger.fatal(...)"critical"logger.panic(...)"critical"ArgumentsCreate: Loggerr class accepts one or two arguments:{string} Case insensitive name ofminimallog level. defaults to 'info'{dictionary} {'Key':'Value'} pairs, optional. Persistent enrichment fields for all log recordslogger=Loggerr(os.environ["LOG_LEVEL"],{"host":socket.gethostname()})Send:Logger functions accept one or two arguments:{any} Record's "message" field. Traditionally this would be a string or an exception.{dictionary} {'Key':'Value'} pairs, optional. Values should be JSON serializablelogger.info("something, something",{dark:"side"})