Saravanan666/pypi-org huggingface dataset:
Package: loggers
loggersloggersis a Python library that provides usefull wrapper methods for logging class. To be used as a superclass for your own classes.Example>>>fromloggersimportLoggers>>>>>>classspamClass(Loggers):...def__init__(self,log_folder=None):...super(spamClass,self).__init__('spamClass',log_folder_path=log_folder)...defdo_stuff(self,arg):...ifnottype(arg)==str:...self.log.error("I was expecting a string. :( ")...else:...self.log.debug("I received my string. :)")...>>>spam=spamClass('/tmp/logs/spamClass')>>>spam.log.error('ERROR')Log:ERROR|Loglevel:ERROR|Date:31/10/201616:51:47>>>spam.set_log_rotate_handler(True)>>>spam.do_stuff(123)Log:Iwasexpectingastring.:(|Loglevel:ERROR|Date:31/10/201616:51:47>>>spam.do_stuff('Eggs')>>>spam.set_log_level('DEBUG')Log:ChanginglogleveltoDEBUG|Loglevel:DEBUG|Date:31/10/201616:51:47>>>spam.do_stuff('Spam')Log:Ireceivedmystring.:)|Loglevel:DEBUG|Date:31/10/201616:51:47InstallationTo install loggers, simply run:$ pip install loggersloggers is compatible with Python 2.6+ and Python 3Documentationhttps://loggers.readthedocs.ioSource CodeFeel free to fork, evaluate and contribute to this project.Source:https://github.com/jonDel/loggersLicenseGPLv3 licensed.
Package: logger_server
An async TCP logging server base on tornado.ioloop, which serve for logging.handlers.SocketHandler.IntroduceTo solvePython separate processes logging to same file.Official description:Although logging is thread-safe, and logging to a single file from multiple threads in a single process is supported,
logging to a single file from multiple processes is not supported, because there is no standard way to serialize access
to a single file across multiple processes in Python. If you need to log to a single file from multiple processes, one
way of doing this is to have all the processes log to a SocketHandler, and have a separate process which implements a
socket server which reads from the socket and logs to file.Reference:logging cookbookLoggerServerusetornadobuild a high-performance TCP logging server to slove this problem.DocumentationSeeLoggerServer Documentation.
Package: logger-setup
This repository contains a collection of logging functions used mainly by applications fromaccessible apps.While you are more than welcome to include this module standalone, it was meant specifically for use with continuum projects and might be considered somewhat uncompromising otherwise.FeaturesA CrashLogger to handle unplanned application crashesInitialization of debug and error logsOptionally logs all unhandled tracebacks for later analysisSupport for remote logging to a syslog server
Package: logger_sio_client
nanuaddnumb1Node.js module that generates a nanu-addnumb1.Uses crypto.randomBytes when available, falls back to unsafe methods for node.js <= 0.4.To increase performance, random bytes are buffered to minimize the number of synchronous calls to crypto.randomBytes.Installation$ npm install nanu-addnumb1Usagevar add = require('nanu-addnumb1');console.log(add(1,3,343,4,34,345));
Package: logger-slg
from logger_slg import init_loggerinit_logger(name = 'default_logger',
log_path = '/var/log/slg/default_location.log',
log_level = 'INFO',
stream_log_level = 'DEBUG',
formatter_str = '%(asctime)s | %(levelname)-8s | Line %(lineno)-4s | %(pathname)s | %(message)s',
max_bytes=10000000,
backup_count=5
)
Package: loggertodb
Insert meteorological station data to EnhydrisLicenseFree software: GNU General Public License v3Documentationhttps://loggertodb.readthedocs.io.Creating a Windows executableNote:You have to work on Windows 7. If you work on Windows 10, the
resulting executable might not run on Windows 7. If you find a way to
create the executable on Windows 10 that runs on Windows 7 (or stop
supporting Windows 7), fix this README.We’ve found that executables created on 64-bit Windows 7 do run on
32-bit Windows 7, however ideally the resulting executable should be
tested in both environments.The first time:Installgit.Install a recent Python 3 version.Execute Git Bash.Clone loggertodb.Change to the working directory ofloggertodb.pip installvirtualenv==16.1.0(this is because of apyinstaller bug).virtualenv../venv../venv/Scripts/pipinstall-e.../venv/Scripts/pipinstall "pyinstaller<5"Next times:../venv/Scripts/pipinstall-e.(to upgrade dependencies if needed)../venv/Scripts/pythonsetup.py testrm-rdist loggertodb.spec../venv/Scripts/pyinstaller--onefile--name=loggertodbbin/loggertodb-windowsAfter this,loggertodb.exeshould be in thedistdirectory.
Package: logger-util
logger_utilDead simple Python logger.This library redirects the stdout and stderr to a Log object that saves the text printed to the console to a file.  The file is auto-generated and is named based on the number of files in the log directory.  Adding simple LogLevel attributes at the start of your printed debug text allows the log to be parsed and separately into severity levels.Install using:pip install logger-util==0.2fromlogger_utilimportCreateLogger,log_startupif__name__=="__main__":CreateLogger()log_startup()print("INFO: This is a test message.")Calling CreateLogger will instantiate all the necessary variables, files, and directories.  Nothing more needs to be done other than writing to the console.This library is licensed under the MIT license.
Package: loggerV
loggerVA logger class, and a decorator that works with that class for pythonInstallationUse the package managerpipto install loggerV.pipinstallloggerVBasic UsagefromloggerV.loggerimportLogger# Creates an instance of class Loggerlogger=Logger("Logger")logger.append(step="First Log",message="Testing",success=True,)Advanced UsagefromloggerV.loggerimportLoggerfromloggerV.loggerimportfuncLogger# Create a custom dataclass to use in the loggerclassExample:def__init__(self,one,two)->None:self.one=oneself.two=two# Create a new instance of the Logger classlogger=Logger(name="Logger")# A method decorated with the funcLogger method. It accepts the logger as an argument.# fail is what precedence the logger should use if the decorated functions fails. (Optional)# success is what precedence the logger should use if the decorated function succeeds. (Optional)# run is what level of logging to use. 0: no loging, even if it fails. 1: log if the function fails. 2: log whether it failsor succeeds@funcLogger(logger)defconvert(string,run=0,fail=None,success=None):returnint(string)# Load the custom class so that it can be used in the loggerlogger.loadCustom(names=["fieldOne","fieldTwo"],printValues=["One","Two"],defaults=None,dontPrintIf=None,)# The way partitions work is that each partition has a precedence. There are two partitions by default. main with a precedence of 3 and footer with a precedence of ten.# Partitions and precedence can be created through the below method, and can be used in the append function. by default append uses partition main (3).# Logs in the same partition are ordered by first come first servelogger.addPartition(name="first",precedence=1)# Create a new Loglogger.append(step="First Log",message="Testing",custom=Example(one="Hello",two="World"),success=True,partition="main",)logger.append("Second Log","Testing",success=False,partition=1)logger.append("Third Log")print(logger)ContributingPull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMIT
Package: logger-via
General PurposeThe package holds two decorators that can wrap a python function and save the details of it's execution
into a log. The details include the name of the function, args and kwargs and what did the function return.
This is achieved by means of redirecting stderr and stdout to a file or an email (depending on which
decorator is used)@log - decorator save the log into a file. A relative path: 'output/log.txt' is used by default. Does not require
preliminary setup in "config.py" unless another output directory wanted.@email_log - decorator send the log by email. The usage require SMTP server to be configured at "config.py".Package Compositionconfig.pyThe setup and configuration file with constants used in the logger.LOG_FILE:     The path to a log saved by @log decorator. 'output/log.txt' is used by default.

SENDER:       The sender's email will be displayed in the From: field (in the body of the letter).
              May be helpful to specify an email to receive email replies from log recipients.
              Actual email that sends out the letter depend strongly on SMTP server policy.
RECEIVER:     An email where the logs will be sent.
MAIL_SERVER:  A functioning and adjusted SMTP server.
PORT:         SMTP port (an integer)
USERNAME:     SMTP username (received from SMTP server. Frequently - a sender's email)
PASSWORD:     SMTP password (received from SMTP server. Frequently - a sender's password)SUGGESTION: The package was tested with AWS "Simple Email Service" SMTP provider (https://aws.amazon.com/ses/).logger.pyThe decorators themselves are described in this file. If the output format needs modification, the f-strings in decorators
can be modified here.Operation ManualTo use the package follow the steps:pip install logger_viamodify SMTP details in "config.py"from logger import log / from logger import email_logwrap the functions with @log / @email_logLicenseThe package designed by Vladimir Iakimenko (https://github.com/VladIakimenko).Free for distribution, modification or contribution.With feedback address tov_yakimenko@inbox.ru
Package: loggg
logtc: Python Logging LibraryOverviewlogtcis a versatile Python logging library designed for modern web services. It provides advanced logging capabilities including context-aware logging for request and internal tasks, automatic file rotation based on time intervals, and socket-based logging with automatic Socket.IO support.Key FeaturesContext-Aware Logging: Log messages are tagged with a unique context, making it easier to trace logs back to specific requests or internal tasks.Automatic File Rotation: Log files are automatically rotated based on configurable time intervals, helping manage log file sizes and organization.Socket Logging: Real-time logging through web sockets, with built-in support for Socket.IO.Easy Integration with Web Frameworks: Designed to be easily integrated with frameworks like FastAPI.InstallationYou can installlogtcvia pip:pipinstalllogtcSetup and ConfigurationBasic Logger SetupTo set up the logger, import theLogtcfromlogtcand configure it with your preferences:fromlogtcimportLoggerLogtc().setup(name="test")Logtc().setup_file_handler(file_path="../log/.log",when="M",interval=1)Logtc().setup_socket_handler(url="http://localhost:8000",handshake_path="/logtc/socket.io")Logtc().setup_stream_handler()Parameters:name: Name of the logging service.file_path: Path to the log file.whenandinterval: Controls the log file rotation. For instance, "M" and 1 means the file rotates every minute.url: URL for the socket logging server.handshake_path: Handshake path for the Socket.IO server.Context-Aware LoggingFor logging with request or task-specific contexts:fromlogtcimportlogtc_context# Set a unique identifier for the current contextlogtc_context.set(UNIQUE_ID)Each log message will include this unique identifier, making it easier to correlate logs with specific requests or tasks.Socket Logging with FastAPITo use socket logging with FastAPI, mount thesocketfromlogtc:fromfastapiimportFastAPIfromlogtcimportsockettcapp=FastAPI()# Mount the socket loggerapp.mount("/logtc",sockettc())This sets up an endpoint for the Socket.IO server, enabling real-time log streaming.UsageAfter setting uplogtc, you can use its logger to log messages of different severities:fromlogtcimportLogtc# Logging an info messageLogtc().logger.info("This is an info message.")# Logging a warning messageLogtc().logger.warning("This is a warning message.")# Logging an error messageLogtc().logger.error("This is an error message.")# Logging a debug messageLogtc().logger.debug("This is a debug message.")# Logging a critical messageLogtc().logger.critical("This is a critical message.")ContributingContributions tologtcare welcome! Please refer to the repository's contribution guidelines for more details.Licenselogtcis released under MIT License.
Package: loggi
loggilogger boilerplate with dataclass models for parsingInstallationInstall with:pip install loggiUsage>>> import loggi
>>> logger = loggi.getLogger("demo", "logs")The file "demo.log" will be created inside a folder named "logs" in the current directory.loggi wraps the logging level mapping so the log level can be set without importing the logging module>>> logger.setLevel(loggi.DEBUG)Also loggi imports the logging module when it's initialized, so all logging module features can be utilized without explicity importing logging yourself>>> print(loggi.logging.getLevelName(loggi.INFO))
INFOloggi uses the format{level}|-|{date}|-|{message}where date has the format%x %X>>> logger.info("yeehaw")produces the logINFO|-|10/26/23 18:48:30|-|yeehawloggi also contains two dataclasses:LogandEvent.ALogobject contains a list ofEventobjects that can be loaded from a log file (that uses the above format).EachEventcontainslevel: str,date: datetime,message: strfields.>>> log = loggi.load_log("logs/demo.log")
>>> print(log)
INFO|-|10/26/23 18:48:30|-|yeehaw
>>> print(log.num_events)
1
>>> print(log.events[0].level)
INFOLogobjects can be added together.Useless examples:>>> log += log
>>> print(log)
INFO|-|2023-10-26 18:48:30|-|yeehaw
INFO|-|2023-10-26 18:48:30|-|yeehawNew, filteredLogobjects can be created using thefilter_dates,filter_levels, andfilter_messagesfunctions.>>> from datetime import datetime, timedelta
>>> log = loggi.load_log("realistic_log.log")Filtering for events between 24 and 48 hours ago:>>> filtered_log = log.filter_dates(datetime.now() - timedelta(days=2), datetime.now() - timedelta(days=1))Filtering for events with critical and error levels:>>> filtered_log = log.filter_levels(["CRITICAL", "ERROR"])Filtering for events whose message contains "yeehaw", but not "double yeehaw" or "oopsie":>>> filtered_log = log.filter_messages(["*yeehaw*"], ["*double yeehaw*", "*oopsie*"])The filtering methods can be chained:>>> log_slice = log.filter_dates(datetime.now() - timedelta(days=2), datetime.now() - timedelta(days=1)).filter_levels(["CRITICAL", "ERROR"])When addingLogobjects, thechronosort()function can be used to reorder the events by date:>>> log = filtered_log + log_slice
>>> log.chronosort()lognow contains all critical and error level events between 24 and 48 hours ago,
as well as events from anytime of any level with "yeehaw" in the message, but not "double yeehaw" or "oopsie".
Package: loggia
LoggiaThe documentation is available on Github PagesRead it onlineObjectiveThe objective of this package is to provide a simple and standard way to configure logging in Python applications, using the standardloggingmodule, and compatible withloguru.We aim for a batteries-included, no configuration required, delightful out-of-the box experience.The bundled configuration is opinionated and suits our purposes well, but we recognize your opinion will differ and provide various mechanisms of increasing complexity to tune logging to your liking.Loggia isnota new Python logger - it's a nice way to configure - and share configuration - for Python's standard logging and as well as loguru.!!! warning
While this package is in an early 0.x release, it's built upon years of
development and production usage in various projects.Loggia as a logging configuration bundle is young, but the configuration
itself is what we most enjoyed working with for some time now.UsageAdd theloggiadependency to your project, e.g.: with PDM:Directly from Pypi:pdm add loggiaWith Git:pdm add "loggia @ git+ssh://git@github.com/manomanotech/loggia.git"#!python from loggia.logger import initialize; initialize()is a strong starting pointYou should call this as early as possible in your application, ideally before any other code is run, for instance by adding it in your main__init__.pyfile.Read theUsagedocs should you need to tune things.FeaturesDelightful standard logging configuration inprettyorstructuredmodeCompatibility withloguru(WIP) - you can keep using Loguru's API as much as you like or need it, while Loggia takes care of all the other standard-logging based loggers.Configuringsys.excepthookto properly log uncaught exceptionsUsinglogging.captureWarningsto log warningsConfiguring the standard logger andloguruto use the same handlersOnly one non-optional dependencyCode standards & PrinciplesLean towards being way too typed rather than untypedDo not depend on third-party packages (WIP)Do not crash unless explicitly asked to - fallback to sensible things, emit a warning, and move on.Supported versionsWe currently support Python 3.9, 3.10, 3.11 and 3.12.We may drop the support for a Python version before its end of life, to keep the codebase up to date with the latest Python features: i.e.: we will endeavor to support either the last 3 or 4 stable Python releases.We don't plan to support earlier versions or different runtimes.
Package: loggify
Loggify: capture prints and tracebacks to a log file with 2 lines of codeLoggify is a convenient way to redirect stdout and stderr to the timestamped log file. It works by temporarily overriding the default behaviour ofsys.stdoutandsys.stderrin the context manager. You still see the output in the console - it is just additionally streamed to the log file (see the example below).Installation$pipinstallloggifyUsagescript.py:fromloggifyimportLoggifydefmain():print("START")foriinrange(10):print(" "*i+"x")print("END")5/0# traceback will be capturedwithLoggify("main.log"):# specify output filenamemain()main.log:2020-04-07 20:45:18.391:STDOUT:START
2020-04-07 20:45:18.391:STDOUT:x
2020-04-07 20:45:18.391:STDOUT: x
2020-04-07 20:45:18.391:STDOUT:  x
2020-04-07 20:45:18.391:STDOUT:   x
2020-04-07 20:45:18.391:STDOUT:    x
2020-04-07 20:45:18.391:STDOUT:     x
2020-04-07 20:45:18.391:STDOUT:      x
2020-04-07 20:45:18.391:STDOUT:       x
2020-04-07 20:45:18.391:STDOUT:        x
2020-04-07 20:45:18.391:STDOUT:         x
2020-04-07 20:45:18.392:STDOUT:END
2020-04-07 20:45:18.392:STDERR:Traceback (most recent call last):
2020-04-07 20:45:18.392:STDERR:  File "script.py", line 11, in <module>
2020-04-07 20:45:18.392:STDERR:    main()
2020-04-07 20:45:18.392:STDERR:  File "script.py", line 8, in main
2020-04-07 20:45:18.392:STDERR:    5 / 0   # traceback will be captured
2020-04-07 20:45:18.392:STDERR:ZeroDivisionError: division by zeroLicenseMIT License (seeLICENSE).
Package: logging2
A More Pythonic Logging System;or,You Deserve Better Than log4jThe Basic Contract of LoggingLogging should be simple and intuitive.For most use cases, you want to quickly instantiate a logger and dump some text
to a stream. You would expect a common workflow based on a minimum level of
verbosity in the log entries and for those entries to be formatted in some
fashion that is both human readable and machine parseable. There should also be
a set of common metadata that can be used to provide context to the entry.That context should also be easily extended to suit everyone’s use cases.
Additionally, the values passed to that context should be pliable - users should
have the option to override those values as they deem necessary.Common meta information should conform to as widely adopted standards as
possible - i.e. ISO 8601 timestamps and full unicode supported messages.As stated foremost, the interface to this system should be simple and
intuitive. This means the complexity of the system should be minimized,
configuration should have sane defaults and the supporting library should
be packed with expressive documentation.Implementation of the ContractThe user should only be concerned with three components:Verbosity (LogLevel)Message Producers (Handler)Message Creation (Logger)Installationlogging2is available through PyPI, and thus can be installed via pip:$ pip install logging2QuickstartLogging should be simple and intuitive. With that in mind, the easiest way to get up and running is
to instantiate aLoggerand start producing entries:>>> from logging2 import Logger

>>> logger = Logger('app')
>>> logger.info('Hello, world!')
2017-04-29T17:08:23.156795+00:00 INFO app: Hello, world!The default logger will dump all log entries to STDOUT with a minimum verbosity ofinfo.There are numerous configurations, all with simple and easy to rationalize behavior:log entry verbositylog producers (handlers)intuitive interface to creating log entries (loggers)Loggers have a handful of ways of creating log entries via:debugfor the most verbose level of messagesinfofor typical informational messageswarningfor calling user attention to a potentially hazardous conditionserrorfor altering users to captured and recovered from error conditionsexceptionfor capturing exception tracebacks in the logThe mechanism for producing the log entries to the output streams is viaHandlers. Handlers
are broken into three groups:streamingfor common IO messaging (typically STDOUT and STDERR)filesfor file system based IOsocketsfor network based messagingAll of which are found in thelogging2.handlerspackage.CaveatsThis logging utility is designed for Python 3.6 and better.It will not be
backported to support any earlier versions of Python.
Package: logging2telegram
logging2telegramFastest and simple handler for stream logging output to telegram chats.InstallationYou can install or upgrade package with PIP:$ pip install logging2telegram --upgradeOr you can install from source with:$ git clone https://github.com/tezmen/logging2telegram
$ cd logging2telegram
$ python setup.py install...or install from source buth with pip$ pip install git+https://github.com/tezmen/logging2telegram.gitExampleimportlogging.configimportlogginglogging.config.dictConfig({'version':1,'formatters':{'tg_full':{'class':'log2tg.HtmlFormatter',}},'handlers':{'telegram':{'level':'DEBUG','class':'log2tg.TelegramHandler','formatter':'tg_full','disable_web_page_preview':True,'token':'BOT:TOKEN','ids':[123,132,321],},},'loggers':{'myapp':{'handlers':['telegram']}},})defshow():logger=logging.getLogger('myapp')logger.warning('we have <b>a</b> warning')if__name__=='__main__':show()For custom formating:'formatters':{'tg_full':{'class':'log2tg.HtmlFormatter','format':'<b>%(level)s</b>%(filename)s:%(message)s<code>%(exc_text)s</code>'}}
Package: logging2telegram-ng
logging2telegram-ngThis is a fork oflogging2telegram,
aiming to integrate some features fromtelegram-logging.Fastest and simple handler for stream logging output to telegram chats.InstallationYou can install or upgrade package with PIP:$ pip install logging2telegram-ng --upgradeOr you can install from source with:$ git clone https://github.com/jmfernandez/logging2telegram-ng.git
$ cd logging2telegram-ng
$ python setup.py install...or install from source buth with pip$ pip install git+https://github.com/jmfernandez/logging2telegram-ng.gitExampleimportlogging.configimportlogginglogging.config.dictConfig({'version':1,'formatters':{'tg_full_ng':{'()':'log2tg_ng.NgHtmlFormatter',}},'handlers':{'telegram':{'level':'DEBUG','class':'log2tg_ng.NgTelegramHandler','formatter':'tg_full_ng','disable_web_page_preview':True,'token':'BOT:TOKEN','ids':[123,132,321],},},'loggers':{'myapp':{'handlers':['telegram']}},})defshow():logger=logging.getLogger('myapp')logger.warning('we have <b>a</b> warning')if__name__=='__main__':show()For custom formating:'formatters':{'tg_full':{'()':'log2tg_ng.NgHtmlFormatter','use_emoji':False,'format':'<b>%(level)s</b>%(filename)s:%(message)s<code>%(exc_text)s</code>'}}
Package: logging4
logging4A tiny logging toolinstall$pipinstall--upgradelogging4usageimportsysimportlogging4logger=logging4.Logger(name="MyLogger")formatter='[[time]] - [[name]] - [[level_name]] - [[msg]]'# add/del channellogger.add_channel(filename='log.txt',level=logging4.WARNING)logger.add_channel(filename=sys.stdout,level=logging4.ERROR,formatter=formatter)logger.add_channel(filename='log2.txt',level=logging4.INFO)logger.del_channel(filename='log2.txt')use logger:logger.debug('logger debug message')logger.info('logger info message')logger.warning('logger warning message')logger.error('logger error message')logger.critical('logger critical message')