logngraph


Namelogngraph JSON
Version 0.0.9 PyPI version JSON
download
home_pageNone
SummaryDraw primitives and save your logs!
upload_time2025-08-24 12:45:36
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseNone
keywords log logging graphics primitives pygame
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # LogNGraph
*A Python 3.12 package for easily drawing primitives and saving log files*

## Functionality
> ⚠️ You're entering WIP territory ⚠️

### Logs
1. Create Logger instance:
    ```python
    from logngraph.log import get_logger
    from logngraph.log.levels import *
    logger = get_logger(__name__, filename="my_log_file.txt", level=TRACE)  # Look for everything
                                                          # By default, log level is INFO
    ```
   > ⚠️ get_logger parameters: ⚠️
   > - name: Name of the module/logger
   > - filename: Filename of the log file
   > - level: Logging level
   > - file_colors: If True, will write colorful text to the log file. (Can not be colorful in some editors)
   > - force_write: If True, write logs to the log file (if not None), even if level is higher.
2. Then just log!
    ```python
    logger.trace("When you need to know EVERY detail")
    logger.debug("Diagnosing or troubleshooting an issue")
    logger.info("Something has happened, e.g. started a server")
    logger.warn("Something unexpected has happened,"
                " but code will continue running")
    logger.error("App hit an issue that prevents a certain "
                 "function from working, e.g. payment system is offline"
                 "but the program can still continue running")
    logger.fatal("Something crucial has stopped working, e.g"
                 "lost connection to the main server, can't"
                 "continue running")
    ```
That's it!
You can also change the log level:
```python
logger.set_level(WARNING)
# WARNING was imported earlier from logngraph.log.levels
```

> ⚠️ Here's a hierarchy of log levels: ⚠️
> - TRACE   - e.g. what packets client received from the server
> - DEBUG   - e.g. game server froze, and you need to see why
> - INFO    - e.g. someone said something in chat, and you saved it in logs
> - WARNING - e.g. lost connection to the server temporarily
> - ERROR   - e.g. lost connection to the server completely (timeout, etc.)
> - FATAL   - e.g. client could not find models for the characters
> - NONE    - e.g. you don't want logs ¯\\\_(ツ)\_/¯

> ⚠️ Write to file happens when one of the log methods is called ⚠️

### Graphics
1. Create a Window instance:
    ```python
    from logngraph.graph import Window
    window = Window("My title", 800, 800, resizable=True)
    ```
2. Draw primitives:
    ```python
    window.fill("#000000")  # fills whole window with color
    window.rect(0, 0, 100, 100, color="#777777")
    window.rect((10, 10), (250, 50), color="#ff00ff")   # or like this
    window.circle(25, 20, 15)   # at (25, 20) with radius 15
    window.ellipse(0, 0, 80, 100)  # from (0, 0) to (80, 100)
    window.line(0, 0, 800, 900, color="#0000ff")
    window.polygon(750, 750, 800, 400, 35, 600, color="#ff0000")
    # Also you can display text!
    window.write(60, 150, text="Hello, World!", color="#ffffff", bg_color="#000000", antialias=True, size=32, font="Arial")
    ```
3. And update the screen:
    ```python
    window.update()
    ```
    ⚠️ And if doing this in loop don't forget to `window.handle_quit()`! ⚠️
4. You can also save the screen:
    ```python
    window.screenshot("screenshot.png")
    ```
That's all!

# Installation
Use pip:
```bash
pip install logngraph
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "logngraph",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "log, logging, graphics, primitives, pygame",
    "author": null,
    "author_email": "Vadim Gladushev <vadim.gladushev@mail.ru>",
    "download_url": "https://files.pythonhosted.org/packages/cf/a1/dfbd2a746a1462b08c2378691eaf24bf63b8068c0b6f6d43fb0776845244/logngraph-0.0.9.tar.gz",
    "platform": null,
    "description": "# LogNGraph\r\n*A Python 3.12 package for easily drawing primitives and saving log files*\r\n\r\n## Functionality\r\n> \u26a0\ufe0f You're entering WIP territory \u26a0\ufe0f\r\n\r\n### Logs\r\n1. Create Logger instance:\r\n    ```python\r\n    from logngraph.log import get_logger\r\n    from logngraph.log.levels import *\r\n    logger = get_logger(__name__, filename=\"my_log_file.txt\", level=TRACE)  # Look for everything\r\n                                                          # By default, log level is INFO\r\n    ```\r\n   > \u26a0\ufe0f get_logger parameters: \u26a0\ufe0f\r\n   > - name: Name of the module/logger\r\n   > - filename: Filename of the log file\r\n   > - level: Logging level\r\n   > - file_colors: If True, will write colorful text to the log file. (Can not be colorful in some editors)\r\n   > - force_write: If True, write logs to the log file (if not None), even if level is higher.\r\n2. Then just log!\r\n    ```python\r\n    logger.trace(\"When you need to know EVERY detail\")\r\n    logger.debug(\"Diagnosing or troubleshooting an issue\")\r\n    logger.info(\"Something has happened, e.g. started a server\")\r\n    logger.warn(\"Something unexpected has happened,\"\r\n                \" but code will continue running\")\r\n    logger.error(\"App hit an issue that prevents a certain \"\r\n                 \"function from working, e.g. payment system is offline\"\r\n                 \"but the program can still continue running\")\r\n    logger.fatal(\"Something crucial has stopped working, e.g\"\r\n                 \"lost connection to the main server, can't\"\r\n                 \"continue running\")\r\n    ```\r\nThat's it!\r\nYou can also change the log level:\r\n```python\r\nlogger.set_level(WARNING)\r\n# WARNING was imported earlier from logngraph.log.levels\r\n```\r\n\r\n> \u26a0\ufe0f Here's a hierarchy of log levels: \u26a0\ufe0f\r\n> - TRACE   - e.g. what packets client received from the server\r\n> - DEBUG   - e.g. game server froze, and you need to see why\r\n> - INFO    - e.g. someone said something in chat, and you saved it in logs\r\n> - WARNING - e.g. lost connection to the server temporarily\r\n> - ERROR   - e.g. lost connection to the server completely (timeout, etc.)\r\n> - FATAL   - e.g. client could not find models for the characters\r\n> - NONE    - e.g. you don't want logs \u00af\\\\\\_(\u30c4)\\_/\u00af\r\n\r\n> \u26a0\ufe0f Write to file happens when one of the log methods is called \u26a0\ufe0f\r\n\r\n### Graphics\r\n1. Create a Window instance:\r\n    ```python\r\n    from logngraph.graph import Window\r\n    window = Window(\"My title\", 800, 800, resizable=True)\r\n    ```\r\n2. Draw primitives:\r\n    ```python\r\n    window.fill(\"#000000\")  # fills whole window with color\r\n    window.rect(0, 0, 100, 100, color=\"#777777\")\r\n    window.rect((10, 10), (250, 50), color=\"#ff00ff\")   # or like this\r\n    window.circle(25, 20, 15)   # at (25, 20) with radius 15\r\n    window.ellipse(0, 0, 80, 100)  # from (0, 0) to (80, 100)\r\n    window.line(0, 0, 800, 900, color=\"#0000ff\")\r\n    window.polygon(750, 750, 800, 400, 35, 600, color=\"#ff0000\")\r\n    # Also you can display text!\r\n    window.write(60, 150, text=\"Hello, World!\", color=\"#ffffff\", bg_color=\"#000000\", antialias=True, size=32, font=\"Arial\")\r\n    ```\r\n3. And update the screen:\r\n    ```python\r\n    window.update()\r\n    ```\r\n    \u26a0\ufe0f And if doing this in loop don't forget to `window.handle_quit()`! \u26a0\ufe0f\r\n4. You can also save the screen:\r\n    ```python\r\n    window.screenshot(\"screenshot.png\")\r\n    ```\r\nThat's all!\r\n\r\n# Installation\r\nUse pip:\r\n```bash\r\npip install logngraph\r\n```\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Draw primitives and save your logs!",
    "version": "0.0.9",
    "project_urls": null,
    "split_keywords": [
        "log",
        " logging",
        " graphics",
        " primitives",
        " pygame"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c8b42cf16b351e12bd91935e99e92ac2c0d38b9dc9e8456ebbc38719319c0e46",
                "md5": "3012cc78371c88c53ad740253eaede07",
                "sha256": "0c7788f308778ce970dfa242a4de10fc8450398a9710fbfa901dd4432fe836f2"
            },
            "downloads": -1,
            "filename": "logngraph-0.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3012cc78371c88c53ad740253eaede07",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 7476,
            "upload_time": "2025-08-24T12:45:35",
            "upload_time_iso_8601": "2025-08-24T12:45:35.547715Z",
            "url": "https://files.pythonhosted.org/packages/c8/b4/2cf16b351e12bd91935e99e92ac2c0d38b9dc9e8456ebbc38719319c0e46/logngraph-0.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "cfa1dfbd2a746a1462b08c2378691eaf24bf63b8068c0b6f6d43fb0776845244",
                "md5": "4e3bf8d222f9fd8c3e8ed17dd84d5ad2",
                "sha256": "111c54c17af1ed0b2e482393da33e8ae5cbc61cb335bc9a0f3bcf6749a9d9dd1"
            },
            "downloads": -1,
            "filename": "logngraph-0.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "4e3bf8d222f9fd8c3e8ed17dd84d5ad2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 8419,
            "upload_time": "2025-08-24T12:45:36",
            "upload_time_iso_8601": "2025-08-24T12:45:36.810975Z",
            "url": "https://files.pythonhosted.org/packages/cf/a1/dfbd2a746a1462b08c2378691eaf24bf63b8068c0b6f6d43fb0776845244/logngraph-0.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-24 12:45:36",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "logngraph"
}
        
Elapsed time: 0.76131s