aiologging


Nameaiologging JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/users/zvenios/projects/2
SummaryAsynchronous module for logging in python.
upload_time2025-01-18 15:24:47
maintainerNone
docs_urlNone
authorzvenios
requires_python>=3.11
licenseNone
keywords aio log logger logging aiolog aiologger aiologging
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # aiologging #

## What's new in 1.0.1? ##

**Fixed bugs:**
> By passing the level in 'str' to "logger.log()", specifying any text that will be used for recording.

> It is possible to specify the level in 'int' in "logger.log()" less than 0 and greater than 5, so the log was at the level of 'None'.

**New function**

> async def error_handler(time, name, level: str, msg):

It is used to handle errors on behalf of the module. It is not recommended to use it externally.

## What is this? ##
**aiologging** - asynchronous module for logging asynchronous applications.

#### Starting from version 2.0.0, logs will be written to a file and output to "print", specifying this in "aiologging.Logger()", before version 2.0.0 they were output only in "print()". ####

## Quick Guide

---

**Connecting the module:**
> import aiologging

---

**Getting the logger:**
> logger = aiologging.Logger(name="logger name")

The 'name=' parameter is optional, the default value is 'root'.

---

**Logging:**
> await logger.log(level, message)

> await logger.log(2, message) # level = INFO (int)

> await logger.log("INFO", message) # level = INFO (str)

> await logger.log(aiologging.INFO, message) # level = INFO (int)

> from aiologging import NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL
> await logger.log(INFO, message) # level = INFO (int)

Replace 'INFO' or '2' with the desired int/str level.

level is 'str' or 'int'.

| str | int |
|--|--|
| CRITICAL, FATAL | 5 |
| ERROR | 4 |
| WARNING, WARN | 3 |
| INFO | 2 |
| NOTSET | 0 |
| DEBUG | 1 |

---

### the records have the following format: ###
> 2025-01-18 16:10:16.271609 :: NAME :: LEVEL :: MESSAGE

**2025-01-18 16:10:16.271609 - date and time of the log.**
**NAME - the name of the logger, by default 'root'.**
**LEVEL - log level (NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL).**
**MESSAGE - the log message.**

---

# Other functions #

---

> async def levelToName(level: int):

Accepts level in 'int' and returns 'str' the name of the level (2 - "INFO")

---

> async def nameToLevel(level: str):

Accepts level name in 'str' and returns 'int' the number of the level ("INFO" - 2)

---

# Global variables #

---

CRITICAL = 5
FATAL = CRITICAL
ERROR = 4
WARNING = 3
WARN = WARNING
INFO = 2
DEBUG = 1
NOTSET = 0

---

_levelToName = {
    CRITICAL: 'CRITICAL',
    ERROR: 'ERROR',
    WARNING: 'WARNING',
    INFO: 'INFO',
    DEBUG: 'DEBUG',
    NOTSET: 'NOTSET',
}

---

_nameToLevel = {
    'CRITICAL': CRITICAL,
    'FATAL': FATAL,
    'ERROR': ERROR,
    'WARN': WARNING,
    'WARNING': WARNING,
    'INFO': INFO,
    'DEBUG': DEBUG,
    'NOTSET': NOTSET,
}

---

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/users/zvenios/projects/2",
    "name": "aiologging",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "aio log logger logging aiolog aiologger aiologging",
    "author": "zvenios",
    "author_email": "kont.05.vladdd@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6c/bf/90ace7d0bcfe6298bb7d5582a950af1ee395ae4e60cd5ff01310ea3422e2/aiologging-1.0.1.tar.gz",
    "platform": null,
    "description": "# aiologging #\r\n\r\n## What's new in 1.0.1? ##\r\n\r\n**Fixed bugs:**\r\n> By passing the level in 'str' to \"logger.log()\", specifying any text that will be used for recording.\r\n\r\n> It is possible to specify the level in 'int' in \"logger.log()\" less than 0 and greater than 5, so the log was at the level of 'None'.\r\n\r\n**New function**\r\n\r\n> async def error_handler(time, name, level: str, msg):\r\n\r\nIt is used to handle errors on behalf of the module. It is not recommended to use it externally.\r\n\r\n## What is this? ##\r\n**aiologging** - asynchronous module for logging asynchronous applications.\r\n\r\n#### Starting from version 2.0.0, logs will be written to a file and output to \"print\", specifying this in \"aiologging.Logger()\", before version 2.0.0 they were output only in \"print()\". ####\r\n\r\n## Quick Guide\r\n\r\n---\r\n\r\n**Connecting the module:**\r\n> import aiologging\r\n\r\n---\r\n\r\n**Getting the logger:**\r\n> logger = aiologging.Logger(name=\"logger name\")\r\n\r\nThe 'name=' parameter is optional, the default value is 'root'.\r\n\r\n---\r\n\r\n**Logging:**\r\n> await logger.log(level, message)\r\n\r\n> await logger.log(2, message) # level = INFO (int)\r\n\r\n> await logger.log(\"INFO\", message) # level = INFO (str)\r\n\r\n> await logger.log(aiologging.INFO, message) # level = INFO (int)\r\n\r\n> from aiologging import NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL\r\n> await logger.log(INFO, message) # level = INFO (int)\r\n\r\nReplace 'INFO' or '2' with the desired int/str level.\r\n\r\nlevel is 'str' or 'int'.\r\n\r\n| str | int |\r\n|--|--|\r\n| CRITICAL, FATAL | 5 |\r\n| ERROR | 4 |\r\n| WARNING, WARN | 3 |\r\n| INFO | 2 |\r\n| NOTSET | 0 |\r\n| DEBUG | 1 |\r\n\r\n---\r\n\r\n### the records have the following format: ###\r\n> 2025-01-18 16:10:16.271609 :: NAME :: LEVEL :: MESSAGE\r\n\r\n**2025-01-18 16:10:16.271609 - date and time of the log.**\r\n**NAME - the name of the logger, by default 'root'.**\r\n**LEVEL - log level (NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL).**\r\n**MESSAGE - the log message.**\r\n\r\n---\r\n\r\n# Other functions #\r\n\r\n---\r\n\r\n> async def levelToName(level: int):\r\n\r\nAccepts level in 'int' and returns 'str' the name of the level (2 - \"INFO\")\r\n\r\n---\r\n\r\n> async def nameToLevel(level: str):\r\n\r\nAccepts level name in 'str' and returns 'int' the number of the level (\"INFO\" - 2)\r\n\r\n---\r\n\r\n# Global variables #\r\n\r\n---\r\n\r\nCRITICAL = 5\r\nFATAL = CRITICAL\r\nERROR = 4\r\nWARNING = 3\r\nWARN = WARNING\r\nINFO = 2\r\nDEBUG = 1\r\nNOTSET = 0\r\n\r\n---\r\n\r\n_levelToName = {\r\n    CRITICAL: 'CRITICAL',\r\n    ERROR: 'ERROR',\r\n    WARNING: 'WARNING',\r\n    INFO: 'INFO',\r\n    DEBUG: 'DEBUG',\r\n    NOTSET: 'NOTSET',\r\n}\r\n\r\n---\r\n\r\n_nameToLevel = {\r\n    'CRITICAL': CRITICAL,\r\n    'FATAL': FATAL,\r\n    'ERROR': ERROR,\r\n    'WARN': WARNING,\r\n    'WARNING': WARNING,\r\n    'INFO': INFO,\r\n    'DEBUG': DEBUG,\r\n    'NOTSET': NOTSET,\r\n}\r\n\r\n---\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Asynchronous module for logging in python.",
    "version": "1.0.1",
    "project_urls": {
        "GitGub": "https://github.com/zvenios",
        "Homepage": "https://github.com/users/zvenios/projects/2"
    },
    "split_keywords": [
        "aio",
        "log",
        "logger",
        "logging",
        "aiolog",
        "aiologger",
        "aiologging"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c37db5a1e1e5c597ee2e355fd61e92a589d9d872f4ff9a54d02ac0f5ce6078de",
                "md5": "923839def4c90397dd5ea830a20ed21d",
                "sha256": "40f2c83b2bad11a683efd88c2fc75eacf56d3f9162c98c2b86c04ff07b638af8"
            },
            "downloads": -1,
            "filename": "aiologging-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "923839def4c90397dd5ea830a20ed21d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 3327,
            "upload_time": "2025-01-18T15:24:45",
            "upload_time_iso_8601": "2025-01-18T15:24:45.267569Z",
            "url": "https://files.pythonhosted.org/packages/c3/7d/b5a1e1e5c597ee2e355fd61e92a589d9d872f4ff9a54d02ac0f5ce6078de/aiologging-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6cbf90ace7d0bcfe6298bb7d5582a950af1ee395ae4e60cd5ff01310ea3422e2",
                "md5": "f12b97c787f3e63ba76d05b1a4ff650c",
                "sha256": "ae2c761e9d5f8a15f026e984ba74af0d76d899475805ebe29179213598dfa71b"
            },
            "downloads": -1,
            "filename": "aiologging-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f12b97c787f3e63ba76d05b1a4ff650c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 3079,
            "upload_time": "2025-01-18T15:24:47",
            "upload_time_iso_8601": "2025-01-18T15:24:47.190584Z",
            "url": "https://files.pythonhosted.org/packages/6c/bf/90ace7d0bcfe6298bb7d5582a950af1ee395ae4e60cd5ff01310ea3422e2/aiologging-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-18 15:24:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "users",
    "github_project": "zvenios",
    "github_not_found": true,
    "lcname": "aiologging"
}
        
Elapsed time: 0.48972s