Saravanan666/pypi-org huggingface dataset:
Package: logformatjson
logformatjsonis a library that provides a simple JSON formatter for the standard python logging package. It allows for nested arbitrary metadata to be inserted at instantiation and run time. The library is opionanted but attempts to allow most opinions to be overridden.warning: This library is under active development. The log format and API are expected to change.Installviapip:pipinstalllogformatjsonExamplesbasic usage - JSONFormatter can be set on any handler as your would expect:importloggingimportsysfromlogformatjsonimportJSONFormatterLOGGER=logging.getLogger()LOGGER.setLevel(logging.DEBUG)log_handler=logging.StreamHandler(sys.stdout)log_handler.setFormatter(JSONFormatter())LOGGER.addHandler(log_handler)LOGGER.debug('this is my debug message',extra={'some_key':'important_value'})which produces the following json (from ipython):{"timestamp":"2016-02-19T19:39:17.061886","message":"this is my debug message","levelname":"DEBUG","metadata":{"filename":"test.py","funcName":"<module>","extra":{"some_key":"important_value"},"log_type":"python","lineno":11,"module":"test","pathname":"test.py"},"log_version":"1.0"}Adding an additional metadata ineverylog entry:…log_handler.setFormatter(JSONFormatter(metadata={'application_version':'1.0.0'}))…Overriding the defaults at instantiation:Override attributes copied or skipped from theLogRecord:…log_handler.setFormatter(JSONFormatter(kept_attrs=['created',…]))log_handler.setFormatter(JSONFormatter(skipped_attrs=['filename',…]))…Override the provided json encoder:defmy_json_encoder(obj):returnint(obj)…log_handler.setFormatter(JSONFormatter(json_encoder=my_json_encoder))…Override the defaults at runtime:Log type (intended to be mixed with extra fields):…logger.debug('GET / HTTP/1.1',log_type='HTTP'}…Extra fields:…LOGGER.debug('this is my debug message',extra={'some_key':'important_value'})…TestsTests can be run viamake:makelintmaketestAuthorsRyan Richard <ryan@kumoru.io>
Package: logfrog
FrogLogFrogLog is an efficient, thread-safe logging library in Python. This nimble logger, designed with simplicity, offers non-blocking, asynchronous logging, making it perfect for applications that prioritize performance.FeaturesAsynchronous Logging:Dispatch logs to a separate thread, freeing your application from waiting on IO operations.Log Levels:Differentiate the importance of messages withINFO,DEBUG,WARNING,ERROR, andCRITICALlevels.Function Logging:Automatically log function calls, tracking names, arguments, and return values.Stack Tracing:Log the current stack trace, invaluable for debugging and understanding complex code execution paths.UsagefromfroglogimportFrogLoglogger=FrogLog(filename="app.log")# Dispatch logslogger.info("Info message")logger.debug("Debug message")logger.warning("Warning message")logger.error("Error message")logger.critical("Critical message")# Log function calls@logger.log_functiondeftest_function(a,b):returna+btest_function(2,3)# Log current stacklogger.log_stack()# Gracefully stop the loggerlogger.stop()ContributingThanks for making it this far! Here are some pointers to get you started -Feature SuggestionsConfigurable Log Formats:Allow users to customize the format of the log output, such as including the file name and line number, or changing the timestamp format.Remote Logging:Add support for logging to remote systems, such as logging servers or cloud storage.Performance Metrics:Log system performance metrics like memory and CPU usage.Integration with Monitoring Tools:Provide easy integration with popular monitoring and alerting tools.Log Rotation:Implement automatic log rotation to prevent logs from consuming too much disk space.Filtering and Searching:Provide capabilities to filter and search logs based on certain criteria, such as log level, timestamp, or content.Thank you for your interest in FrogLog. We look forward to your contributions!
Package: logfury
LogfuryLogfury is a tool for python library maintainers. It allows for responsible, low-boilerplate logging of method calls.whats with the weird importfromlogfury.v1importDefaultTraceMetaIf you were to use logfury in your library, any change to the API could potentially break your program. Nobody wants that.Thanks to this import trick I can keep the API very stable. At the same time I can change the functionality of the library and change default behavior of next middle version, without changing the name of the package. This way YOU decide when to adopt potentially incompatible API changes, by incrementing the API version on import. This concept is called “apiver”.InstallationCurrent stablepip install logfuryDevelopment versiongit clone git@github.com:reef-technologies/logfury.git
pip install -e .Basic usageDefaultTraceMeta metaclass>>>importlogging>>>importsix>>>>>>fromlogfury.v1importDefaultTraceMeta,limit_trace_arguments,disable_trace>>>>>>>>>logging.basicConfig()>>>logger=logging.getLogger(__name__)>>>logger.setLevel(logging.DEBUG)>>>>>>>>>@six.add_metaclass(DefaultTraceMeta)>>>classFoo:...defbaz(self,a,b,c=None):...returnTrue...defget_blah(self):...return5...def_hello(self):...pass...@disable_trace...defworld(self):...pass...def__repr__(self):...return'<{}object>'.format(self.__class__.__name__,)...>>>classBar(Foo):...defbaz(self,a,b,c=None):...b+=1...returnsuper(Bar,self).baz(a,b,c)...defworld(self):...pass...@limit_trace_arguments(skip=['password'])...defsecret(self,password,other):...pass...@limit_trace_arguments(only=['other'])...defsecret2(self,password,other):...pass...>>>a=Foo()>>>a.baz(1,2,3)DEBUG:__main__:calling Foo.baz(self=<Foo object>, a=1, b=2, c=3)>>>a.baz(4,b=8)DEBUG:__main__:calling Foo.baz(self=<Foo object>, a=4, b=8)>>>a.get_blah()# nothing happens, since v1.DefaultTraceMeta does not trace "get_.*">>>a._hello()# nothing happens, since v1.DefaultTraceMeta does not trace "_.*">>>a.world()# nothing happens, since v1.DefaultTraceMeta does not trace "_.*">>>b=Bar()>>>b.baz(4,b=8)# tracing is inheritedDEBUG:__main__:calling Bar.baz(self=<Bar object>, a=4, b=8)
DEBUG:__main__:calling Foo.baz(self=<Bar object>, a=4, b=9, c=None)>>>b.world()# nothing happens, since Foo.world() tracing was disabled and Bar inherited it>>>b.secret('correct horse battery staple','Hello world!')DEBUG:__main__:calling Bar.secret(self=<Bar object>, other='Hello world!') (hidden args: password)>>>b.secret2('correct horse battery staple','Hello world!')DEBUG:__main__:calling Bar.secret2(other='Hello world!') (hidden args: self, password)trace_call decorator>>>importlogging>>>fromlogfuryimport*>>>logging.basicConfig()>>>logger=logging.getLogger(__name__)>>>>>>@trace_call(logger)...deffoo(a,b,c=None):...returnTrue...>>>foo(1,2,3)True>>>logger.setLevel(logging.DEBUG)>>>foo(1,2,3)DEBUG:__main__:calling foo(a=1, b=2, c=3)
True>>>foo(1,b=2)DEBUG:__main__:calling foo(a=1, b=2)
True>>>
Package: logga
LoggaOverviewInstallationDevelopmentPrerequisitesGetting Started(macOS Users only) Upgrading GNU MakeCreating the Local EnvironmentLocal Environment MaintenanceHelpRunning the Test HarnessOverviewPython logging made super easy!Refer toLogga's documentationfor detailed instructions.InstallationWithpip:pip install loggagit-syntax:logga @ git+https://github.com/loum/logga.git@<release_version>DevelopmentPrerequisitesGNU makePython 3 Interpreter.We recommend installing pyenvDockerGetting StartedMakesteris used as the Integrated Developer Platform.(macOS Users only) Upgrading GNU MakeFollowthese notesto getGNU make.Creating the Local EnvironmentGet the code and change into the top levelgitproject directory:git clone https://github.com/loum/logga.git && cd loggaNOTE:Run all commands from the top-level directory of thegitrepository.For first-time setup, get theMakester project:git submodule update --initInitialise the environment:make init-devLocal Environment MaintenanceKeepMakester projectup-to-date with:git submodule update --remote --mergeHelpThere should be amaketarget to get most things done. Check the help for more information:make helpRunning the Test HarnessWe usepytest. To run the tests:make teststop
Package: loggaby
Loggaby-py🐍 Simple, minimal logging for Python without useless features.Loggaby-py is a direct port (aims to be, anyway) of theoriginal JSversion. It does 1 thing and does it well: posting nice logs to a terminal. Or perhaps a file? Anywhere you need can be done with a Transport (not present in this Python version as yet).Oh, it looks like this:(Exactly like the original)Table of ContentsInstallExamplesDocsLicenseInstallpip install loggabyExamplesProvided Here.DocumentationLoggaby(debug=False, levels=[])The Loggaby constructor, which creates aloggerinstance.debug{Boolean} Whether to print debug messages. (Default:True)levelsAdditional custom levels to provide. (An array ofdicts)name{str} Name of the level that appears in the logscolor{str} Color of thename(accepted values aretheseor a hex value)debug{bool} Whether this is a debug log (that is hidden withdebug: false)fatal{bool} Whether to make the level name and message bold and underlinecall{str} Name of the function to use this levelLevelsdebug,log,warn,error,fatalby default.You can log withlogger.<Level>(). (examples)LicenseLoggaby-py is licensed under the MIT license.Read herefor more info.ALuvellaproject.
Package: loggedfs
SynopsisLoggedFS-python is a FUSE-based filesystem which can log every operation that happens in it.
It is a pure Python re-implementation ofLoggedFSbyRémi Flamentmaintaining CLI compatibility.
The project is heavily inspired byStavros Korokithakis’ 2013 blog post entitled
“Writing a FUSE filesystem in Python” (source code repository).
The filesystem is fullyPOSIXcompliant, passing thepjdfstest test-suite, a descendant of FreeBSD’sfstest.
It furthermore passes stress tests with fsx-linux based on thefsx-flavorreleased by theLinux Test Project.
It is intended to be suitable for production systems.CAVEATSPROJECT STATUS:BETATHE FILESYSTEM IS CURRENTLYONLYBEING DEVELOPED FOR AND TESTED ONLINUX.
ANYONE INTERESTED IN CONFIRMING MAC OS X AND/OR ADDING BSD SUPPORT?InstallationFrom thePython Package Index(PyPI):pipinstallloggedfsFrom GitHub:pipinstallgit+https://github.com/pleiszenburg/loggedfs-python.git@masterSupports Python 3.{5,6,7,8}.Supports Linux.Support for MAC OS X and BSD is implemented but has yet not been tested.Simple usage exampleTo start recording access to/tmp/TESTinto/root/log.txt, just do:sudologgedfs-p-s-l/root/log.txt/tmp/TESTTo stop recording, just unmount as usual:sudofusermount-u/tmp/TESTCLI usageloggedfs--helpUsage:loggedfs[OPTIONS]DIRECTORYOptions:-fDonotstartasadaemon.Writelogstostdoutifnologfileisspecified.-pAlloweveryusertoseethenewloggedfs.-cFILENAMEUsethe"config-file"tofilterwhatyouwanttolog.-sDeactivateloggingtosyslog.-lFILEUsethe"log-file"towritelogsto.-j,--jsonFormatoutputasJSONinsteadoftraditionalloggedfsformat.-b,--buffersIncluderead/write-buffers(compressed,BASE64)inlog.-m,--only-modify-operationsExcludeloggingofalloperationsthatcannotcausechangesinthefilesystem.Convenienceflagforacceleratedlogging.--helpShowthismessageandexit.ConfigurationLoggedFS-python can use an XML configuration file if you want it to log operations only for certain files, for certain users, or for certain operations. LoggedFS-python is fully compatible with configuration files in LoggedFS’ original format. Yet it can also handle additional fields (e.g. thecommandfield).Here is a sample configuration file :<?xml version="1.0" encoding="UTF-8"?><loggedFSlogEnabled="true"printProcessName="true"><includes><includeextension=".*"uid="*"action=".*"retname=".*"command=".*"/></includes><excludes><excludeextension=".*\.bak$"uid="*"action=".*"retname="SUCCESS"command=".*"/><excludeextension=".*"uid="1000"action=".*"retname="FAILURE"command=".*"/><excludeextension=".*"uid="*"action="getattr"retname=".*"command=".*"/></excludes></loggedFS>This configuration can be used to log everything except if it concerns a*.bakfile, or if theuidis 1000, or if the operation isgetattr.Need help?Feel free to post questions in theGitHub issue trackerof this project.Bugs & issuesPlease report bugs in LoggedFS-python here in itsGitHub issue tracker.MiscellaneousLibrary documentation:LoggedFS-python Jupyter NotebookLicense(Apache License 2.0)Contributing(Contributions are highly welcomed!)AuthorsChangesLong-term ideasUpstream issues(relevant bugs in dependencies)
Package: logged_requests
Logged Requestslogged_requestsis a simple wrapper around therequests.Sessionobject. It capturesinput and outputdata of arequests.Sessionobject.Installationpipinstalllogged_requestsQuickstart>>>url='https://httpbin.org/post'>>>fromlogged_requestsimportLoggedRequests>>>req=LoggedRequests()>>>resp=req.post(url,json={"name":"jsoh"})2016-04-1221:09:56INFOlogged_requests.logged_requests.request:POSThttps://httpbin.org/post2016-04-1221:09:57DEBUGlogged_requests.logged_requests.request:RequestHeaders:Content-Length:16|Accept-Encoding:gzip,deflate|Accept:*/*|User-Agent:python-requests/2.9.1|Connection:keep-alive|Content-Type:application/json|2016-04-1221:09:57INFOlogged_requests.logged_requests.request:RequestPayload:'{"name": "josh"}'2016-04-1221:09:57INFOlogged_requests.logged_requests.request:Statuscode:2002016-04-1221:09:57DEBUGlogged_requests.logged_requests.request:ResponseHeaders:'Content-Length:   411 | Server: nginx | Connection: keep-alive | Access-Control-Allow-Credentials: true | Date: Tue, 12 Apr    2016 19:09:57 GMT | Access-Control-Allow-Origin: * | Content-Type: application/json | '2016-04-1221:09:57DEBUGlogged_requests.logged_requests.request:ResponseContent:'{\n"args":{},\n"data": "{\\"name\\":\\"josh\\"}",\n"files":{},\n"form":{},\n"headers": {\n"Accept":   "*/*",\n"Accept-Encoding": "gzip, deflate",\n"Content-Length": "16",\n"Content-Type":   "application/json",\n"Host": "httpbin.org",\n"User-Agent": "python-requests/2.9.1"\n},\n"json": {\n"name": "josh"\n},\n"origin": "82.227.125.5",\n"url":    "https://httpbin.org/post"\n}\n'LoggedRequestsobject can be initiated with a custom logger. If not initiated with a logger,logged_requestwill initiate a default logger, withStreamHandleras defaulthandlerandDEBUGas defaultloggging level>>>url='https://httpbin.org/post'>>>fromlogged_requestsimportLoggedRequests>>>req=LoggedRequests(my_custom_logger)
Package: loggen
loggenis a shell command to generate syslog messages to a remote host.LicensingThis software project is provided under the licensing terms of the
MIT License stated in the fileLICENSE.rst.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: logger2telegram
OverviewThis package includes simple pure python telegram bot that sends logs to chat.Algorithmfromlogger2telegramimportLogger2tlgtlg=Logger2tlg(chat_id="123456789",bot_id="123456789:ABCDEF1234567890ABCDEF1234567890ABC")tlg.log("Hello world!")Create bot via bot_father bot in telegramInsert bot token to classInsert chat id to class:https://stackoverflow.com/a/32572159/9142932Create instance of logger viatlg = Logger2tlg(chat_id = "-123456789", bot_id = "BOT TOKEN FROM BOT FATHER")Send urgent logs viatlg.log("This is message")You may create multiple loggers to different chats or bots.Installationpip install logger2tlg
Package: logger-36
InstallationThis project is published
on thePython Package Index (PyPI)at:https://pypi.org/project/logger-36/.
It should be installable from Python distribution platforms or Integrated Development Environments (IDEs).
Otherwise, it can be installed from a command console:For all users, after acquiring administrative rights:First installation:pip installlogger-36Installation update:pip install--upgradelogger-36For the current user (no administrative rights required):First installation:pip install--userlogger-36Installation update:pip install--user--upgradelogger-36DocumentationThe documentation is available athttps://src.koda.cnrs.fr/eric.debreuve/logger-36/-/wikis/home.AcknowledgmentsThe project is developed withPyCharm Community.The development relies on several open-source packages
(seeinstall_requiresinsetup.py, if present; otherwiseimportstatements should be searched for).The code is formatted byBlack,The Uncompromising Code Formatter.The imports are ordered byisort…your imports, so you don’t have to.
Package: logger4py
Logger4pyCustom logging moduleUsageinstall packagepip install logger4pyHow to use logger4pyfrom logger4py import Logger  
log = Logger.get_logger('my_module')
# 'my_module' is the name of the logger object got from the logger4py.json file in 'loggers' section  

log.debug('this is a debug message')  
log.info('this is an info message')  
log.error('this is an error message')  
log.warning('this is a warning message')Demo2021-05-20T00:06:20.736	DEBUG	35692	44080	test_log	this is a debug message      
2021-05-20T00:06:20.736	INFO	35692	44080	test_log	this is an info message    
2021-05-20T00:06:20.736	ERROR	35692	44080	test_log	this is an error message    
2021-05-20T00:06:20.736	WARNING	35692	44080	test_log	this is a warning message    
2021-05-20T10:13:09.552	DEBUG	42864	43524	test_log	this is a debug message    
2021-05-20T10:13:09.552	INFO	42864	43524	test_log	this is an info message    
2021-05-20T10:13:09.552	ERROR	42864	43524	test_log	this is an error message    
2021-05-20T10:13:09.553	WARNING	42864	43524	test_log	this is a warning messageConfiguration fileDefault configuration file path:module directory/logger4py.json.\<your virtual environment>\Lib\site-packages\logger4py\logger4py.jsonIn my test environment :C:\Users\mahmoud.aouinti\Desktop\test\env\Lib\site-packages\logger4py\logger4py.jsonDefault Configuration file content:{
  "version": 1,
  "disable_existing_loggers": false,
  "formatters": {
    "simple": {
      "datefmt": "%Y-%m-%dT%H:%M:%S",
      "format": "%(asctime)s.%(msecs)03d\t%(levelname)s\t%(thread)d\t%(process)d\t%(module)s\t%(message)s"
      
    },
    "simple_message": {
      "datefmt": "%Y-%m-%dT%H:%M:%S",
      "format": "%(message)s"
      
    }
  },

  "handlers": {
    "console": {
      "class": "logging.StreamHandler",
      "level": "DEBUG",
      "formatter": "simple",
      "stream": "ext://sys.stdout"
    },

    "info_file_handler": {
      "class": "logging.handlers.RotatingFileHandler",
      "level": "DEBUG",
      "formatter": "simple",
      "filename": "info.log",
      "maxBytes": 10485760,
      "backupCount": 20,
      "encoding": "utf8"
    }
  },

  "loggers": {
     "my_module": {
        "level": "DEBUG",
        "handlers": ["info_file_handler"],
        "propagate": false
      }
    },

  "root": {
    "level": "ERROR",
    "handlers": ["console", "info_file_handler"]
  }
}
Package: logger-app
DocumentationThe documentation is hosted athttps://github.com/BingerYang/logger_appInstallationpipinstalllogger_appUsageexample:# -*- coding: utf-8 -*-

from logger_app import FormatterRule, LoggerApp
from flask import request, Flask

app = Flask(__name__)
app.config['PROPAGATE_EXCEPTIONS'] = False  # 设置是否传递异常 , 如果为True, 则flask运行中的错误会显示到网页中, 如果为False, 则会输出到文件中


# FormatterRule.CB_TAG_MAP = dict(path=lambda: request.path, md5=lambda: request.host_url)


@app.route('/')
def index():
    # num = 1 / 0
    app.logger.error('this is a error')
    return "index"


if __name__ == '__main__':
    app.logger = LoggerApp(__name__, fmt=FormatterRule(style='json')).create_logger()

    app.run(debug=True)
Package: loggerbase
LoggerbasePython version: >=3.11 (Looking into making it >=3.9)This package provides an easy way to quickly deploy a logging solution in the form of file, stream and database logging to your projects.Easy to set up with just a toml config and environment fileSwitch between multiple logging configurationsMake use of the power of the logging libraryStandard out and error captureLogging to databaseExamples can be found in the project onthe gitlab pageand will be provided on a later date in this README.When using the database functionality please install sqlalchemy firstpip install sqlalchemy
Package: logger-builder
Logger builderPackage meant to be a facade for native logging. It simplifies the creation of the logger and
using several handlers.PrerequisitesPython > 3.6InstallationThe Package is available directly on the Python Package Indexpip install logger_builderRunningThe use of the basic stream logger involves initialization of the formatter, stream handler factory,
logger builder, and running the create logger function.from logger_builder import LoggerBuilder
from logger_builder.formatter import create_formatter
from logger_builder.handler.factory import StreamHandlerFactory

if __name__ == "__main__":
    formatter = create_formatter(simple_description=True)

    stream_handler_factory = StreamHandlerFactory(formatter)

    handler_factories = [stream_handler_factory]
    logger_builder = LoggerBuilder(handler_factories)
    logger = logger_builder.create_logger("example")

    logger.info(f"Log something")Log to file , and buffering handler factories were implemented as well (FileHandlerFactory, and
MemoryHandlerFactory, respectively).Change Log0.0.3Released on 2022-05-06.AddedChangedCorrected project description in PyPIRemoved0.0.2Released on 2022-05-04.AddedMemory handler so that the logs are not emitted one by one, but in batches.ChangedImproved basic formatter, so that different logging information can be included.Removed