sample-loggers


Namesample-loggers JSON
Version 0.0.5 PyPI version JSON
download
home_pageNone
SummaryThis package provides sample loggers.
upload_time2025-08-21 09:47:53
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords python tools logger
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Deep Learning Tools for Pytorch

[![Python >= 3.8](https://img.shields.io/badge/python->=3.8-blue.svg)](https://www.python.org/downloads/release/)

This package provides some common configurations to quickly create your own logger through the logging library. 

## Installation

```bash
pip install sample_loggers
```

## Example for using
To ues the logger directly, you can use the `logger` object provided by the package. 
```python
import os
from sample_loggers import logger

# you can set the log dir and log file name through environment variables.
os.environ["LOG_DIR"] = "./output/log"
os.environ["LOG_FILE_NAME"] = "log.txt"

logger.info("hello world")
```

To define your own logger, you can use the `create_logger` method. This method allows you to specify the name of the logger and the log level.
```python
from sample_loggers import create_logger, LEVEL

# The format can be defined as a string, 
# you can refer to the official website 
# https://docs.python.org/3/library/logging.html#logrecord-attributes.
define_format = "Define your own format here, you can use the default format or define your own format."

logger = create_logger(
    logger_name="logger",
    log_level=LEVEL.INFO,
    log_file_name="log.txt",
    output_dir="./output/log",
    format_type="default",
    define_format=define_format
)
```

## Update
- 0.0.5 - improve the default logger.
- 0.0.4post1 - Fix the bug.
- 0.0.4 - Samplify thr method to create logger and provide the default logger that can be used directly.
- 0.0.3post1 - Fix the bug.
- 0.0.3 - Add the level definition.
- 0.0.2post2 - Fix the bug.
- 0.0.2post1 - Fix the bug.
- 0.0.2 - Add the summery and throughput method.
- 0.0.1 - We provide the common config for logging to create logger.

## License

Sample Loggers is MIT licensed. See the [LICENSE](LICENSE) for details.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sample-loggers",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "python, tools, logger",
    "author": null,
    "author_email": "Ian Zhu <IanZhu@m.ldu.edu.cn>",
    "download_url": "https://files.pythonhosted.org/packages/4e/d3/2ec1e9fe826b20ce47f8f6812a280fe4a04d0496e92b58d0320f4803d8b5/sample_loggers-0.0.5.tar.gz",
    "platform": null,
    "description": "# Deep Learning Tools for Pytorch\n\n[![Python >= 3.8](https://img.shields.io/badge/python->=3.8-blue.svg)](https://www.python.org/downloads/release/)\n\nThis package provides some common configurations to quickly create your own logger through the logging library. \n\n## Installation\n\n```bash\npip install sample_loggers\n```\n\n## Example for using\nTo ues the logger directly, you can use the `logger` object provided by the package. \n```python\nimport os\nfrom sample_loggers import logger\n\n# you can set the log dir and log file name through environment variables.\nos.environ[\"LOG_DIR\"] = \"./output/log\"\nos.environ[\"LOG_FILE_NAME\"] = \"log.txt\"\n\nlogger.info(\"hello world\")\n```\n\nTo define your own logger, you can use the `create_logger` method. This method allows you to specify the name of the logger and the log level.\n```python\nfrom sample_loggers import create_logger, LEVEL\n\n# The format can be defined as a string, \n# you can refer to the official website \n# https://docs.python.org/3/library/logging.html#logrecord-attributes.\ndefine_format = \"Define your own format here, you can use the default format or define your own format.\"\n\nlogger = create_logger(\n    logger_name=\"logger\",\n    log_level=LEVEL.INFO,\n    log_file_name=\"log.txt\",\n    output_dir=\"./output/log\",\n    format_type=\"default\",\n    define_format=define_format\n)\n```\n\n## Update\n- 0.0.5 - improve the default logger.\n- 0.0.4post1 - Fix the bug.\n- 0.0.4 - Samplify thr method to create logger and provide the default logger that can be used directly.\n- 0.0.3post1 - Fix the bug.\n- 0.0.3 - Add the level definition.\n- 0.0.2post2 - Fix the bug.\n- 0.0.2post1 - Fix the bug.\n- 0.0.2 - Add the summery and throughput method.\n- 0.0.1 - We provide the common config for logging to create logger.\n\n## License\n\nSample Loggers is MIT licensed. See the [LICENSE](LICENSE) for details.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "This package provides sample loggers.",
    "version": "0.0.5",
    "project_urls": {
        "homepage": "https://github.com/10-4zz/sample_loggers.git",
        "repository": "https://github.com/10-4zz/sample_loggers.git"
    },
    "split_keywords": [
        "python",
        " tools",
        " logger"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4ce889d44753f2eb87204e4387180659281fb8760c958505578d3e4d6f1b0e20",
                "md5": "109b336ce4030c404afeb12e3c863bd4",
                "sha256": "dc3b51e8fb3c6ba5c8c5879c84c1c56208ef140326e92199a6dd08244cc11813"
            },
            "downloads": -1,
            "filename": "sample_loggers-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "109b336ce4030c404afeb12e3c863bd4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 5941,
            "upload_time": "2025-08-21T09:47:52",
            "upload_time_iso_8601": "2025-08-21T09:47:52.494647Z",
            "url": "https://files.pythonhosted.org/packages/4c/e8/89d44753f2eb87204e4387180659281fb8760c958505578d3e4d6f1b0e20/sample_loggers-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4ed32ec1e9fe826b20ce47f8f6812a280fe4a04d0496e92b58d0320f4803d8b5",
                "md5": "03e3bc82fa95445d0a710407854e9ddd",
                "sha256": "7a47a0f9a9a829856ea85f09bce8de496109c6223f502421d5a8194913aa372e"
            },
            "downloads": -1,
            "filename": "sample_loggers-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "03e3bc82fa95445d0a710407854e9ddd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 4510,
            "upload_time": "2025-08-21T09:47:53",
            "upload_time_iso_8601": "2025-08-21T09:47:53.621128Z",
            "url": "https://files.pythonhosted.org/packages/4e/d3/2ec1e9fe826b20ce47f8f6812a280fe4a04d0496e92b58d0320f4803d8b5/sample_loggers-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-21 09:47:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "10-4zz",
    "github_project": "sample_loggers",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "sample-loggers"
}
        
Elapsed time: 1.08732s