Saravanan666/pypi-org huggingface dataset:
Package: logmiddleware
logmiddlewarelogmiddlewareis a Python library designed for use with FastAPI to simplify the logging of incoming requests and outgoing responses. It includes a middleware component that adds essential information to logs, such as request and response details, and supports debugging features.FeaturesMiddleware for request and response logging:The library provides a middleware component,RouterLoggingMiddleware, to log incoming requests and outgoing responses. It includes features to capture request details, response information, and execution times.Request ID generation:Automatically generates a unique request ID for each incoming request. If the request includes anx-api-request-idheader, it uses that value; otherwise, it generates a new UUID.Debugging support:Enables debugging of response bodies through the use of theapi_debugflag. When enabled, the response body is included in the logs.JSON logging configuration:Utilizes thepython-json-loggerlibrary to configure JSON logging. This allows for structured and easily parsable log entries.InstallationTo install the library, use the following pip command:pipinstalllogmiddlewareUsageSetting up middlewareimportloggingfromfastapiimportFastAPIfromlogmiddlewareimportRouterLoggingMiddleware,logging_config# Configure JSON logginglogging.config.dictConfig(logging_config)app=FastAPI()# Add the middleware to your FastAPI appapp.add_middleware(RouterLoggingMiddleware,logger=logging.getLogger(__name__),# Pass your logger instanceapi_debug=True,# Set to True to enable debugging of response bodies)Accessing request ID in the called functionTheexecute_requestmethod has been updated to set therequest_idin therequest.state. You can now access it in the called function usingrequest.state.request_id. Here is an example:# ...@app.get("/example")asyncdefexample_route(request:Request):# Accessing the request_id in the called functionrequest_id=request.state.request_idreturn{"message":"Hello, world!","request_id":request_id}ConfigurationThe library relies on a logging configuration dictionary (logging_config) to set up JSON logging. Because of that, it includes a default logging configuration (logging_config), which you can import for easy setup. Ensure this configuration is properly set before adding the middleware to your FastAPI app.ContributingIf you find any issues or have suggestions for improvements, please feel free to open an issue or create a pull request on theGit repository.LicenseThis project is licensed under the MIT license.
Package: logmixin
logmixinDescriptionThis is an extremely small Python package (one module, ~40 lines) to enable quick and easy logging within class methods.UsageIt defines a mixin class that adds aget_loggermethod to your class. This method returns a logger with the name of
your module, class, and method that called it. For example, suppose you have a module calledmy_module.pywith these
contents:importloggingfromlogmixinimportLogMixinclassMyClass(LogMixin):"""A class with logging enabled."""defmy_method(self):self.get_logger().info("Hello, world!")if__name__=="__main__":logging.basicConfig(level=logging.INFO)MyClass().my_method()If you run this file, you will see the following output:INFO:my_module.MyClass.my_method:Hello, world!InstallationYou can install this package from PyPI:pipinstalllogmixinLicenseMIT
Package: logmmse
The fork improved on the original version to support Python 3, fixed a few bugs, and made it importable from other Python scriptslogmmseA python implementation of the LogMMSE speech enhancement/noise reduction alogrithmInstallationpip install logmmseBasic Examplefromlogmmseimportlogmmse_from_fileout=logmmse_from_file('sample.wav')print(out)API Referencelogmmse(data, sampling_rate, output_file=None, initial_noise=6, window_size=0, noise_threshold=0.15)data (Mandatory)A 1d or 2d (number of frames, channels) Numpy array representing the audio signalSupported format: 32-bit floating-point, 32-bit PCM, 16-bit PCM, and 8-bit PCM, seehttps://docs.scipy.org/doc/scipy/reference/generated/scipy.io.wavfile.read.htmlsampling_rate (Mandatory)Sampling rate of the data (e.g. 16k/44.1 kHz)output_filenamefilename of the wave output. If none, no file would be generatedthe output format would be the same as inputreturnA 1d or 2d (number of frames, channels) Numpy array representing the enhanced signallogmmse_from_file(data, output_filename=None, initial_noise=6, window_size=0, noise_threshold=0.15)input_filename (Mandatory)Filename of the wave inputsupported format: 32-bit floating-point, 32-bit PCM, 16-bit PCM, and 8-bit PCM, seehttps://docs.scipy.org/doc/scipy/reference/generated/scipy.io.wavfile.read.htmloutput_filenameSee abovereturnA 1d or 2d (number of frames, channels) Numpy array representing the enhanced signalContributeAfter opening an issue or pull request, please also send me an email for notificationReferenceThis file has been ported from logmmse.m file found at the following link.https://raw.githubusercontent.com/braindead/Noise-reduction/master/logmmse.m
Package: logmod
Log all calls to a moduleDependenciesstructlogFeaturesLog all calls to a moduleExample>>>fromlogmodimportlogmod>>>importsecrets>>>logmod(secrets)>>>>>>secret.token_hex(5)logmod:calltosecret.token_hexwith(5,){}'d34eb399f8'Results in:2018-01-09 01:04.15 coolname -> secrets.token_hex at example.py:8 args=(5,) caller=coolname callsite={'filename': 'example.py', 'lineno': 8} func=token_hex kwargs={} mod=secrets
2018-01-09 01:04.15 token_hex -> secrets.token_bytes at /usr/lib/python3.6/secrets.py:58 args=(5,) caller=token_hex callsite={'filename': '/usr/lib/python3.6/secrets.py', 'lineno': 58} func=token_bytes kwargs={} mod=secrets
Hello, f717fd2370
2018-01-09 01:04.15 <module> -> random at example.py:12 args=() caller=<module> callsite={'filename': 'example.py', 'lineno': 12} func=random kwargs={} mod=None
0.46899158604445124
Package: logmongo
Installationpip install logmongo
easy_install logmongoWhat does it do?Gracefully creates capped collections.Auto expires oldest records first and solves log rotation.Writes complex (dicts and kwargs) log records.Logs asynchronously.Collects logs locally or remotely or in a central location.Allows access to logs via MongoDB queries and APIs.Logs newline separated STDIN JSON strings to MongoDBWhy should I use Logmongo instead of just pymongo?Logmongo subclasses the pymongo Collection object and
provides the following additions -By default a new Logmongo object will create a 512M named capped collectionwrite method which:logs all passed keywordsif ‘when’ is not in record, add ‘when’ timestamp to log recordif ‘source’ is not in record, add ‘source’ add FQDN to log recordquery method which:allows keywords (kwargs) querying for example:log.query( tags='finance' )tail method which:prints all records to standard out which match the given query until killedHow does it work?Example:from logmongo import Logmongo

log = Logmongo('logs')

log.write( message='No required kwargs or fields!' )

entry = {
  'tags':['but','we','like','tags'],
  'level':'info'
}
log.write( entry )

# for more help check out
help( logmongo )STDIN JSON to MongoDBExample:# tail the log collection
./logmongo --tail

# in another shell echo a JSON string into logmongo
echo '{"test":[143,435,432]}' | ./logmongo

# for more information
./logmongo --helpLicensePublic DomainHow do I thank you?Write me an email!  I always respond back!
Package: logmux
logmuxLogmux tails multiple log files, labels their lines and outputs everything in
one stream - Much like docker-compose, but simply for local log files!InstallationpipinstalllogmuxUsagelogmuxfirst.logsecond.logtest/third.logThis will tail all three log files. New lines will be prefixed with the name of
the log file it came from, e.g.first:for the first log file andthird:for the last one.You can customize the labels by providing them as a query parameter for each
file:logmux"first.log?label=custom"second.logtest/third.logThis will prefix all lines from the first file withcustom:. You'll need to
quote the argument like in this example to make sure that your shell is not
going to split it.It's also possible to set the color of the label:logmux"first.log?label=custom&color=blue""second.log?color=red"test/third.logSimilar solutionsIn no particular order:MultiTailuses ncurses to tail multiple
log files in one or more windows. Logmux takes a more simple approach by just
printing to stdout.
Package: lognet
LognetLognet is a lightweight logging library for Python, designed to simplify the process of logging messages with different levels of severity. It provides an easy-to-use interface, customization options.FeaturesLog Levels: Log messages with different severity levels, including DEBUG, INFO, WARNING, ERROR, and EXCEPTION.Convenient log message formattingConsole and File Logging: Log messages to the console, a file, or both.InstallationInstall Lognet Logger using pip:pip install lognetARCHITECTURElognet/
в”‚
в”њв”Ђв”Ђcore/
в”‚в”њв”Ђв”Ђ__init__.py
в”‚в”њв”Ђв”Ђapplication/
в”‚в”‚в”њв”Ђв”Ђ__init__.py
в”‚в”‚в”њв”Ђв”Ђlogger.py
в”‚в”‚в”њв”Ђв”Ђhandlers/
в”‚в”‚в”‚в”њв”Ђв”Ђhandler.py
в”‚в”‚в”‚в”њв”Ђв”Ђfile_handler.py
в”‚в”‚в”‚в””в”Ђв”Ђconsole_handler.py
в”‚в”‚в”њв”Ђв”Ђformatters/
в”‚в”‚в”‚в””в”Ђв”Ђlog_formatter.py
в”‚в”њв”Ђв”Ђdomain/
в”‚в”‚в”њв”Ђв”Ђ__init__.py
в”‚в”‚в”њв”Ђв”Ђlog_levels.py
в”‚в”‚в””в”Ђв”Ђlog_entity.py
в”‚в”њв”Ђв”Ђconfiguration/
в”‚в”‚в”њв”Ђв”Ђ__init__.py
в”‚в”‚в”њв”Ђв”Ђhandler_configurator.py
в”‚в”‚в””в”Ђв”Ђlogger_config.pyUsageBasic ExamplefromlognetimportLogger,LogLevel,LoggerConfig,ConsoleHandler,HandlerConfiguratorlogger_config=LoggerConfig(min_level=LogLevel.DEBUG,handler_configurator=HandlerConfigurator(console_handler=ConsoleHandler()))logger=Logger(logger_config)logger.log(level=LogLevel.INFO,message="Example log message")Change formatfromlognetimportLogger,LogLevel,LoggerConfig,ConsoleHandler,HandlerConfiguratorlogger_config=LoggerConfig(log_format="[{time}] [{log_level}]{message}",min_level=LogLevel.DEBUG,handler_configurator=HandlerConfigurator(console_handler=ConsoleHandler()))logger=Logger(logger_config)logger.log(level=LogLevel.INFO,message="Example log message")logger.log(level=LogLevel.ERROR,message="Example error message")File HandlerfromlognetimportLogger,LogLevel,LoggerConfig,HandlerConfigurator,FileHandlerlogger_config=LoggerConfig(min_level=LogLevel.DEBUG,handler_configurator=HandlerConfigurator(console_handler=FileHandler(file_name="log.txt")))logger=Logger(logger_config)logger.log(level=LogLevel.INFO,message="Example log message")logger.log(level=LogLevel.ERROR,message="Example error message")## Future updates
Ideas that I will try to implement
- multithreading
- async
- logging to database
- Filtration
- Settings for each message level separately
- Integration with metrics and tracing
- Support various output formats
- adding tags
- logging in json

## Connect with me/bug/request/suggestion
Check the FEEDBACK.md for information

## Documentation
Check the USAGE.md file for comprehensive examples and configuration details.

## Changelog
Review the CHANGELOG.md file for information on the latest updates and changes.

## License
This project is licensed under the MIT License - see the LICENSE file for details.
Package: logng
LogNGWhat's this?A logging library, intending to simplify the use of logger and easy to configure or implement.InstallpipinstalllogngHow to useloggerIt's a implementation of theILogger, with the high configurability.fromlogng.loggerimportLogger,LogConfiglg=Logger()lg.info("hello info")sharedYou can implementILoggeryourself and set the logger here.fromlogng.sharedimportset_logger,info,warnfromlogng.loggerimportLogger,LogConfigset_logger(Logger())info("hello")warn("hello")
Package: logngo
logngo: Python Logging LibraryOverviewlogngois 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 installlogngovia pip:pipinstalllogngoSetup and ConfigurationBasic Logger SetupTo set up the logger, import theLoggerfromlogngoand configure it with your preferences:fromlogngoimportLoggerLogger().setup(name="test")Logger().setup_file_handler(file_path="../log/.log",when="M",interval=1)Logger().setup_socket_handler(url="http://localhost:8000",handshake_path="logngo/socket.io")Logger().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:fromlogngoimportcontext# Set a unique identifier for the current contextcontext.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 thesocketfromlogngo:fromfastapiimportFastAPIfromlogngoimportsocket_ngoapp=FastAPI()# Mount the socket loggerapp.mount("logngo",socket_ngo())This sets up an endpoint for the Socket.IO server, enabling real-time log streaming.UsageAfter setting uplogngo, you can use its logger to log messages of different severities:fromlogngoimportLogger# Logging an info messageLogger().logger.info("This is an info message.")# Logging a warning messageLogger().logger.warning("This is a warning message.")# Logging an error messageLogger().logger.error("This is an error message.")# Logging a debug messageLogger().logger.debug("This is a debug message.")# Logging a critical messageLogger().logger.critical("This is a critical message.")ContributingContributions tologngoare welcome! Please refer to the repository's contribution guidelines for more details.Licenselogngois released under MIT License.
Package: logni
logni.pylogni is a python library for event logging and application statesHow to install?git (github) #1wget (github) #2pip (python packages) #3Install from Github #1$ git clone https://github.com/erikni/logni.py.git
$ cd logni.py
$ sudo pip3 install -r requirements.txt
$ python3 test/example/basic_example.pyInstall from Github #2$ sudo wget -O - https://raw.githubusercontent.com/erikni/logni.py/master/setup.sh | bashInstall with PIP (Python Package Installer) #3$ pip3 install logni
$ python3 /usr/local/lib/python3/dist-packages/logni/logni.pyExample$ python3

>>> from logni import log

>>> log.mask('ALL')
>>> log.console(1)

>>> log.critical('critical message')
2016/04/01 22:08:18 [15489] F4: critical message [7e995d1a] {logni.py:fatal():161}

>>> log.error('error message #%s', time.time(), priority=4)
2016/04/01 22:08:18 [15489] E4: error message #1459541298.29 [58138001] {logni.py:error():164}

>>> log.warn('warning message #%s', time.time(), priority=3)
2016/04/01 22:08:18 [15489] W3: warning message #1459541298.29 [91b483ab] {logni.py:warn():167}

>>> log.info('info message #%s', time.time(), priority=2)
2016/04/01 22:08:18 [15489] I2: info message #1459541298.29 [eaf58c15] {logni.py:info():170}

>>> log.debug('debug message #%s', time.time(), priority=1)
2016/04/01 22:08:18 [15489] D1: debug message #1459541298.29 [37e911b8] {logni.py:debug():173}SupportLogni support python >= 3.6RoadmapCurrent roadmap:new integration (rollbar, logentries, sentry, ... )performance improvement.Testtest/unitContributionPull Requestsare very welcome.LicenceGNU General Public License v3.0
Package: logNow
logNowis a Python package created to simplify logging for developers working on Python applications. The package provides a simple logging function that allows developers to output log messages to a file with timestamps, instead of using the standard "print" statement.With "logNow", developers can easily create custom log messages and output them to a log file, allowing them to monitor the behavior of their applications and quickly identify any errors or issues that arise. The package provides several useful features, including support for multiple log levels, the ability to configure log formatting, and the option to output logs to the console in addition to the log file.In addition to its core functionality, "logNow" is designed to be easy to use and configure. The package is well-documented, and the code is written in a modular and extensible manner, making it easy for developers to customize and extend its functionality to suit their needs.Overall, "logNow" is a valuable tool for any Python developer looking to simplify their logging process and effectively monitor their applications. Whether you're working on a small hobby project or a large-scale enterprise application, "logNow" can help you keep track of what's happening in your code and quickly identify and fix any issues that arise.Installhttps://pypi.org/project/logNow/pip install logNowUse# To use logNow, you only need to import and write log("a str")

import logNow
from logNow import log

log("hello world")
log("hello red world", "R")
log("hello green world", "G")
log("hello blue world", "B")Output ExampleLizenzMIT LicenseCopyright (c) 2023 NapoII
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, 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 THE
SOFTWARE
Package: lognwrite
Log N WriteLog function executions and variables. Output tostdout.ExampleUselog_functiondecorator to log functions andlog_variableto log values.fromlognwrite.log_to_outimportLogToOut@LogToOut.log_functiondefaddition(a,b):LogToOut.log_variable(a,"a")LogToOut.log_variable(b,"b")returna+baddition(3,50)Executing the example will output:malifpy@malifpy:~$pythonmain.py+ addition( 3, 50 )a = 3b = 50- addition -> 53
Package: logobin
logobin===
A simple command line utility for working with logo.bin files for Android head units based on the ac8227l SoC.This utility is made to simplify the process of extracting the MediaTek header from a logo.bin file or adding it
to an image file you want to use as your boot screen.  All the units I've seen need a 1024x600 pixel bitmap image
in 8-bit RGB color.Help is available from the command line with the -h or --help option, but basic usage is as follows:-c (file)             Test a file for the presence of a valid header.
-u (logo.bin file)    Unpack logo.bin to a header and image file.
-p [(header file) (image file) (optional: filename)]
						Pack header and image into a flashable binfile.If not given, filename defaults to
						logo.binUsing logobin as a module:If you'd like to use this script as a module in some other code, it exposes the following methods:check(these_bytes):Accepts a list of bytes as input, and tests to see if they start with a valid header.logo_bin_pack(header, bmp, filename):Accepts an MTK header, a bitmap file and an optional output filename as input.   Packs a logo.bin file.   If not given, filename defaults to logo.binlogo_bin_unpack(binfile):Accepts a logo.bin with a valid MTK header as input, and unpacks it, producing header.bin and logo.bmpQuestions or comments can be directed tothreadreaper@gmail.com.  Pull requests are welcome if you discover any issues.Copyright \[2020\] \[Michael Podrybau\]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Package: logone
# LogOne![Logone status](https://img.shields.io/pypi/v/logone.svg)A simple logger which supports for logging stdout and stderr streams to console, file, and Loggly for Python## Core Features+ Simple and easy to use, and also compatible with `logging` package+ Supports for logging to console, file, and [Loggly](https://www.loggly.com) service in real-time+ Redirects stdout or stderr stream to the logger as log messages+ Supports for color and formatting to terminal logging (based on `coloredlogs` package)+ Works with Python 2 and 3## Todo+ [ ] Supports for forwarding logs to Facebook Messenger, Slack, ...## Installation`logone` can be installed using [pip](http://www.pip-installer.org):```$ [sudo] pip install logone```## Example UsageHere is an example of how easy it is to get started:```python#!/usr/bin/python# -*- coding: utf-8 -*-import logone# Indicate `DEBUG` level (or higher) for the root loggerlogone.set_level(level=logone.DEBUG)# Now, we can log anything to the root loggerlogone.debug('Quick zephyrs blow, vexing daft Jim')logone.info('How quickly daft jumping zebras vex')def main():# Create a new logger if you do not want to use the root loggerlogger = logone.get_logger('example')logger.set_level(logone.DEBUG)# Log something to the loggerlogger.debug('Debug message')logger.info('Info message')logger.warning('Warn message')# Set up the logger for logging `DEBUG` messages or higher to `example.log` file# Learn more at: https://docs.python.org/3/library/logging.handlers.html#logging.handlers.TimedRotatingFileHandlerlogger.use_file(enabled=True, file_name='logs/example.log', level=logone.DEBUG,when='d', interval=1, backup_count=10)# Set up the logger for logging `DEBUG` messages or higher to Loggly service in real-timelogger.use_loggly(enabled=True, level=logone.DEBUG,loggly_token='YOUR-CUSTOMER-TOKEN', loggly_tag='Python,Example')# Log something to the logger, file, and Loggly servicelogger.error('Error message')logger.critical('Critical message')# Redirect stdout stream to the logger as `INFO` messages (for `print` function,...)logger.redirect_stdout(enabled=True, log_level=logone.INFO)# Redirect stderr stream to the logger as `ERROR` messages (for unexpected error,...)logger.redirect_stderr(enabled=True, log_level=logone.ERROR)# These will be written to stdout stream and then redirected to the loggerprint('Jackdaws love my big sphinx of quartz')value = 20print('Value = ', value)# ZeroDivisionError exception will be written to stderr stream and then redirected to the loggervalue = 1 / 0print(value)if __name__ == '__main__':main()```And here is terminal output:![Demo](https://raw.githubusercontent.com/dnanhkhoa/logone/master/screenshots/demo.png)## LicenseMIT