safelog


Namesafelog JSON
Version 1.8.4 PyPI version JSON
download
home_pagehttps://codeberg.org/topdevpros/safelog
SummarySafelog is a multithread, multiprocess, multiinstance logging package.
upload_time2023-12-31 08:08:01
maintainertopdevpros
docs_urlNone
authorTopDevPros
requires_python>=3.5
licenseGNU General Public License v3 (GPLv3)
keywords logging multiprocess multithread multi-instance
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Safelog
-------

Get instant multithread, multiprocess, and multiprogram safe logs. Safelog also
has a much simpler and more powerful api than standard python logging.


Description
-----------

Safelog is simple multithread, multiprocess, multiprogram logging.

Start as many threads, subprocesses, or programs as you like that all write to the same logs. Safelog instantly creates your logs, and only lets one writer at a time write to each one. Plus it has a much simpler and more powerful api than standard python logging.

    Instant logs
    No conflicts between users or modules
    Organized logs save days or weeks debugging
    Multithread, multiprocess, and multiprogram safe
    Log exceptions and stacktraces simply
    Default log pathnames based on user and module: "/var/local/log/USER/MODULE.log"
    Easy to find the right log
    A master.log for each user shows you all log entries in order


Install
-------

Just and run it. The safeget-safelog installer will download, verify, and install Safelog.
Quick start

Start the safelog server:

        safelog


Or copy the systemd safelog.service file from your python dist-packages/safelock directory (e.g., /usr/local/lib/python3.9/dist-packages/safelog) to the /etc/systemd/system directory. Then you use the following commands to make sure Safelog is available for all of your python apps:

        systemctl enable safelog
        systemctl start safelog


Updates
-------

All future updates will only be available from:

    git clone https://codeberg.org/topdevpros/safelog.git


How it Works
------------

Safelog has a much simpler api than standard python logging. The client code for safelog is solidlibs.python.log.

        from solidlibs.python.log import Log
        log = Log()

        log('log this safely')


Details
-------

The default log file is "/var/local/log/USER/MODULE.log". USER is the current user. MODULE is the python module using solidlibs.python.log.

Log a specified exception and its traceback:

        try:
            raise Exception('test')
        except Exception as exc:
            log(exc)


Log the current exception.

        try:
            raise Exception('test')
        except:
            log.exception()


Log the current exception without traceback.

        try:
            raise Exception('test')
        except:
            log.exception_only()


Log a stacktrace.

        log.stacktrace()


Specify a log filename. Safelog will put it in /var/local/log/USER.

        log = get('special.log')
        log('log message to special.log')


Useful when you want different modules to write to a shared log.

Specify a full log pathname.

        log = get('/tmp/special.log')
        log('log message to /tmp/special.log')


You don't get safe separation for users and modules if you specify a full log pathname.

Logging levels work as usual. The default logging level is DEBUG.

        log.debug('debugging message')
        log.info('informational message')
        log.warning('something went wrong')
        log.error('something went very wrong')

        log('same as log.debug')

Safelog automatically creates timestamped logs safely separated for each user and python module. It also logs every entry to a master log for each user.

The log defaults work especially well in complex systems. When apps run as separate users and share modules, every user and module gets their own logs. There's no conflict over which user owns a log. There are no jumbled log lines from different users or processes.

The safelog server will create directories as needed. If a program bypasses solidlibs.python.log and writes to /var/local/log, it may have to create the directories it uses.

Running a module while in the module directory may not create the log file for that module.

If you are installing Safelog from codeberg.or, be sure to also install the "solidlibs" package.

            

Raw data

            {
    "_id": null,
    "home_page": "https://codeberg.org/topdevpros/safelog",
    "name": "safelog",
    "maintainer": "topdevpros",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "logging multiprocess multithread multi-instance",
    "author": "TopDevPros",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/1d/b6/c79f3c25f722256eff368d10d0cae5987abfe419ddb3deb91a5f0b266cfd/safelog-1.8.4.tar.gz",
    "platform": null,
    "description": "Safelog\n-------\n\nGet instant multithread, multiprocess, and multiprogram safe logs. Safelog also\nhas a much simpler and more powerful api than standard python logging.\n\n\nDescription\n-----------\n\nSafelog is simple multithread, multiprocess, multiprogram logging.\n\nStart as many threads, subprocesses, or programs as you like that all write to the same logs. Safelog instantly creates your logs, and only lets one writer at a time write to each one. Plus it has a much simpler and more powerful api than standard python logging.\n\n    Instant logs\n    No conflicts between users or modules\n    Organized logs save days or weeks debugging\n    Multithread, multiprocess, and multiprogram safe\n    Log exceptions and stacktraces simply\n    Default log pathnames based on user and module: \"/var/local/log/USER/MODULE.log\"\n    Easy to find the right log\n    A master.log for each user shows you all log entries in order\n\n\nInstall\n-------\n\nJust and run it. The safeget-safelog installer will download, verify, and install Safelog.\nQuick start\n\nStart the safelog server:\n\n        safelog\n\n\nOr copy the systemd safelog.service file from your python dist-packages/safelock directory (e.g., /usr/local/lib/python3.9/dist-packages/safelog) to the /etc/systemd/system directory. Then you use the following commands to make sure Safelog is available for all of your python apps:\n\n        systemctl enable safelog\n        systemctl start safelog\n\n\nUpdates\n-------\n\nAll future updates will only be available from:\n\n    git clone https://codeberg.org/topdevpros/safelog.git\n\n\nHow it Works\n------------\n\nSafelog has a much simpler api than standard python logging. The client code for safelog is solidlibs.python.log.\n\n        from solidlibs.python.log import Log\n        log = Log()\n\n        log('log this safely')\n\n\nDetails\n-------\n\nThe default log file is \"/var/local/log/USER/MODULE.log\". USER is the current user. MODULE is the python module using solidlibs.python.log.\n\nLog a specified exception and its traceback:\n\n        try:\n            raise Exception('test')\n        except Exception as exc:\n            log(exc)\n\n\nLog the current exception.\n\n        try:\n            raise Exception('test')\n        except:\n            log.exception()\n\n\nLog the current exception without traceback.\n\n        try:\n            raise Exception('test')\n        except:\n            log.exception_only()\n\n\nLog a stacktrace.\n\n        log.stacktrace()\n\n\nSpecify a log filename. Safelog will put it in /var/local/log/USER.\n\n        log = get('special.log')\n        log('log message to special.log')\n\n\nUseful when you want different modules to write to a shared log.\n\nSpecify a full log pathname.\n\n        log = get('/tmp/special.log')\n        log('log message to /tmp/special.log')\n\n\nYou don't get safe separation for users and modules if you specify a full log pathname.\n\nLogging levels work as usual. The default logging level is DEBUG.\n\n        log.debug('debugging message')\n        log.info('informational message')\n        log.warning('something went wrong')\n        log.error('something went very wrong')\n\n        log('same as log.debug')\n\nSafelog automatically creates timestamped logs safely separated for each user and python module. It also logs every entry to a master log for each user.\n\nThe log defaults work especially well in complex systems. When apps run as separate users and share modules, every user and module gets their own logs. There's no conflict over which user owns a log. There are no jumbled log lines from different users or processes.\n\nThe safelog server will create directories as needed. If a program bypasses solidlibs.python.log and writes to /var/local/log, it may have to create the directories it uses.\n\nRunning a module while in the module directory may not create the log file for that module.\n\nIf you are installing Safelog from codeberg.or, be sure to also install the \"solidlibs\" package.\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3 (GPLv3)",
    "summary": "Safelog is a multithread, multiprocess, multiinstance logging package.",
    "version": "1.8.4",
    "project_urls": {
        "Download": "https://codeberg.org/topdevpros/safelog.git",
        "Homepage": "https://codeberg.org/topdevpros/safelog",
        "Source Code": "https://codeberg.org/topdevpros/safelog/src/branch/main/source"
    },
    "split_keywords": [
        "logging",
        "multiprocess",
        "multithread",
        "multi-instance"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "61ad23ec54cd9a271ddafbb75dbdcfc5ffb4b3e472879886fb7cc72bbcf84710",
                "md5": "7b9fef525ea1d5464d7bb76c56e3f52c",
                "sha256": "63590c34fd4a8fdbe46e5fda3c7f55ccf10f6f15d9ba7a341acb434faa7e2fac"
            },
            "downloads": -1,
            "filename": "safelog-1.8.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7b9fef525ea1d5464d7bb76c56e3f52c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 7024,
            "upload_time": "2023-12-31T08:07:57",
            "upload_time_iso_8601": "2023-12-31T08:07:57.489904Z",
            "url": "https://files.pythonhosted.org/packages/61/ad/23ec54cd9a271ddafbb75dbdcfc5ffb4b3e472879886fb7cc72bbcf84710/safelog-1.8.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1db6c79f3c25f722256eff368d10d0cae5987abfe419ddb3deb91a5f0b266cfd",
                "md5": "4777c7d8e8b95e337469298581176b97",
                "sha256": "10adad245aaea61a462a87bcd52f5a6c537297cc7be62887a30b2ca6166b9aca"
            },
            "downloads": -1,
            "filename": "safelog-1.8.4.tar.gz",
            "has_sig": false,
            "md5_digest": "4777c7d8e8b95e337469298581176b97",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 6915,
            "upload_time": "2023-12-31T08:08:01",
            "upload_time_iso_8601": "2023-12-31T08:08:01.151463Z",
            "url": "https://files.pythonhosted.org/packages/1d/b6/c79f3c25f722256eff368d10d0cae5987abfe419ddb3deb91a5f0b266cfd/safelog-1.8.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-31 08:08:01",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": true,
    "codeberg_user": "topdevpros",
    "codeberg_project": "safelog",
    "lcname": "safelog"
}
        
Elapsed time: 0.56596s