ntlog


Namentlog JSON
Version 0.2 PyPI version JSON
download
home_page
SummaryAppend a log file to an running NestedText log
upload_time2023-04-10 19:32:58
maintainer
docs_urlNone
authorKen Kundert
requires_python>=3.6
license
keywords nestedtext logging
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ntLog — a NestedText logfile aggregation utility
================================================

.. image:: https://pepy.tech/badge/ntlog/month
    :target: https://pepy.tech/project/ntlog

..  image:: https://github.com/KenKundert/ntlog/actions/workflows/build.yaml/badge.svg
    :target: https://github.com/KenKundert/ntlog/actions/workflows/build.yaml

.. image:: https://coveralls.io/repos/github/KenKundert/ntlog/badge.svg?branch=main
    :target: https://coveralls.io/github/KenKundert/ntlog?branch=main

.. image:: https://img.shields.io/pypi/v/ntlog.svg
    :target: https://pypi.python.org/pypi/ntlog

.. image:: https://img.shields.io/pypi/pyversions/ntlog.svg
    :target: https://pypi.python.org/pypi/ntlog/

:Author: Ken Kundert
:Version: 0.2
:Released: 2023-04-10

*ntLog* is a simple command line utility used to append discretely generated log 
files into a running log formulated as a `NestedText <nestedtext.org>`_ file.  
You can specify limits on how many log entries there are or how old they should 
be.  Any entries that do not satisfy the limits are purged.

A discrete log file is a log file generated by program that runs at regular 
intervals or after particular events.  This contrast from log files generated by 
continuously running programs such as daemons.  With discretely running programs 
a existing log file will be overwritten on the next run.  By using *ntLog* you 
can add the most recently generated log file to a running log that will not be 
overwritten.

::

    Usage:

        ntlog [options] <logfile>

    Options:

        -k, --keep-for [days]    drop entries older than this [default: 7]
        -n, --max-entries [N]    maximum number of log entries to keep
        -N, --min-entries [N]    minimum number of log entries to keep [default: 1]
        -d, --delete             delete given logfile after incorporating it
        -h, --help               print this usage message

When run, *ntLog* copies the contents of ``<logfile>`` into ``<logfile>.nt``.

Log entries older than ``--keep-for`` days are deleted.  If units are not 
specified, ``--keep-for`` is given in days.  However you can directly specify 
the units in terms of seconds (s, sec, second, seconds), minutes (m, min, 
minute, minutes), hours (h, hr, hour, hours), days (d, day, days), weeks (w, W, 
week, weeks), months (M, month, months), and years (y, Y, year, years).

If the number of entries exceeds ``--max-entries``, the oldest entries are 
deleted even if they are younger than the ``--keep-for`` limit.

If ``--delete`` is specified, the given log file is deleted after its contents 
are incorporated into the running log file.

The key used when filing log entries into the *NestedText* document is the 
timestamp of the modification time of the given log file.

The given log file is always kept, even if it is older than the ``--keep-for`` 
limit.

Log entries are sorted from most recent to oldest, with the most recent at the 
top of the *NestedText* file.  The one exception to this rule is that the given 
log file is always listed first, even if its modification time is older than 
existing log entries.


Installation
------------

Install with::

    pip install ntlog


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ntlog",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "nestedtext,logging",
    "author": "Ken Kundert",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/94/1b/17e51fa2d15b123a6b07895c765342ae11c38f914ef9c430ebc3f153d07e/ntlog-0.2.tar.gz",
    "platform": null,
    "description": "ntLog \u2014 a NestedText logfile aggregation utility\n================================================\n\n.. image:: https://pepy.tech/badge/ntlog/month\n    :target: https://pepy.tech/project/ntlog\n\n..  image:: https://github.com/KenKundert/ntlog/actions/workflows/build.yaml/badge.svg\n    :target: https://github.com/KenKundert/ntlog/actions/workflows/build.yaml\n\n.. image:: https://coveralls.io/repos/github/KenKundert/ntlog/badge.svg?branch=main\n    :target: https://coveralls.io/github/KenKundert/ntlog?branch=main\n\n.. image:: https://img.shields.io/pypi/v/ntlog.svg\n    :target: https://pypi.python.org/pypi/ntlog\n\n.. image:: https://img.shields.io/pypi/pyversions/ntlog.svg\n    :target: https://pypi.python.org/pypi/ntlog/\n\n:Author: Ken Kundert\n:Version: 0.2\n:Released: 2023-04-10\n\n*ntLog* is a simple command line utility used to append discretely generated log \nfiles into a running log formulated as a `NestedText <nestedtext.org>`_ file.  \nYou can specify limits on how many log entries there are or how old they should \nbe.  Any entries that do not satisfy the limits are purged.\n\nA discrete log file is a log file generated by program that runs at regular \nintervals or after particular events.  This contrast from log files generated by \ncontinuously running programs such as daemons.  With discretely running programs \na existing log file will be overwritten on the next run.  By using *ntLog* you \ncan add the most recently generated log file to a running log that will not be \noverwritten.\n\n::\n\n    Usage:\n\n        ntlog [options] <logfile>\n\n    Options:\n\n        -k, --keep-for [days]    drop entries older than this [default: 7]\n        -n, --max-entries [N]    maximum number of log entries to keep\n        -N, --min-entries [N]    minimum number of log entries to keep [default: 1]\n        -d, --delete             delete given logfile after incorporating it\n        -h, --help               print this usage message\n\nWhen run, *ntLog* copies the contents of ``<logfile>`` into ``<logfile>.nt``.\n\nLog entries older than ``--keep-for`` days are deleted.  If units are not \nspecified, ``--keep-for`` is given in days.  However you can directly specify \nthe units in terms of seconds (s, sec, second, seconds), minutes (m, min, \nminute, minutes), hours (h, hr, hour, hours), days (d, day, days), weeks (w, W, \nweek, weeks), months (M, month, months), and years (y, Y, year, years).\n\nIf the number of entries exceeds ``--max-entries``, the oldest entries are \ndeleted even if they are younger than the ``--keep-for`` limit.\n\nIf ``--delete`` is specified, the given log file is deleted after its contents \nare incorporated into the running log file.\n\nThe key used when filing log entries into the *NestedText* document is the \ntimestamp of the modification time of the given log file.\n\nThe given log file is always kept, even if it is older than the ``--keep-for`` \nlimit.\n\nLog entries are sorted from most recent to oldest, with the most recent at the \ntop of the *NestedText* file.  The one exception to this rule is that the given \nlog file is always listed first, even if its modification time is older than \nexisting log entries.\n\n\nInstallation\n------------\n\nInstall with::\n\n    pip install ntlog\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Append a log file to an running NestedText log",
    "version": "0.2",
    "split_keywords": [
        "nestedtext",
        "logging"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "95623280d4240a8510d60aacba9d37e08b9e824e2378c772a21de20906b01e42",
                "md5": "e6b35fd5c1925fc71589b3720301bcd6",
                "sha256": "d39a5c4d3c543fbc45abce29519cd700491e1e7b0f3cfdf984611b8168b62e5b"
            },
            "downloads": -1,
            "filename": "ntlog-0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e6b35fd5c1925fc71589b3720301bcd6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4409,
            "upload_time": "2023-04-10T19:32:54",
            "upload_time_iso_8601": "2023-04-10T19:32:54.180141Z",
            "url": "https://files.pythonhosted.org/packages/95/62/3280d4240a8510d60aacba9d37e08b9e824e2378c772a21de20906b01e42/ntlog-0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "941b17e51fa2d15b123a6b07895c765342ae11c38f914ef9c430ebc3f153d07e",
                "md5": "3e26b42e3b9f9f16142de0e24cd2bfa2",
                "sha256": "34b0d24c3df5c987c75ec9dd5df7e2c0576cb6d4460798ad4193416464340795"
            },
            "downloads": -1,
            "filename": "ntlog-0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "3e26b42e3b9f9f16142de0e24cd2bfa2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3750,
            "upload_time": "2023-04-10T19:32:58",
            "upload_time_iso_8601": "2023-04-10T19:32:58.549048Z",
            "url": "https://files.pythonhosted.org/packages/94/1b/17e51fa2d15b123a6b07895c765342ae11c38f914ef9c430ebc3f153d07e/ntlog-0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-10 19:32:58",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "ntlog"
}
        
Elapsed time: 0.05364s