# Log N Write
Log function executions and variables. Output to `stdout`.
## Example
Use `log_function` decorator to log functions and `log_variable` to log values.
```python
from lognwrite.log_to_out import LogToOut
@LogToOut.log_function
def addition(a, b):
LogToOut.log_variable(a, "a")
LogToOut.log_variable(b, "b")
return a + b
addition(3, 50)
```
Executing the example will output:
```console
malifpy@malifpy:~$ python main.py
+ addition( 3, 50 )
a = 3
b = 50
- addition -> 53
```
Raw data
{
"_id": null,
"home_page": "https://github.com/malifpy/log-n-write",
"name": "lognwrite",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "log",
"author": "Muhammad Alif Putra Yasa",
"author_email": "malifputrayasa@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/91/8a/a5e7a2985c6e050a4b021c1165f67782b556d13aaf36f576315197129cfe/lognwrite-0.1.3.tar.gz",
"platform": null,
"description": "# Log N Write\n\nLog function executions and variables. Output to `stdout`.\n\n## Example\n\nUse `log_function` decorator to log functions and `log_variable` to log values.\n\n```python\nfrom lognwrite.log_to_out import LogToOut\n\n@LogToOut.log_function\ndef addition(a, b):\n LogToOut.log_variable(a, \"a\")\n LogToOut.log_variable(b, \"b\")\n return a + b\n\naddition(3, 50)\n```\n\nExecuting the example will output:\n\n```console\nmalifpy@malifpy:~$ python main.py\n+ addition( 3, 50 )\n a = 3\n b = 50\n- addition -> 53\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "",
"version": "0.1.3",
"split_keywords": [
"log"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "70184dc8ee157a847c59bc7f6275bf48",
"sha256": "151cdbda497c96752e1b679a7a6f0ad1d3cfb213c001d19bd3eac88516faaf04"
},
"downloads": -1,
"filename": "lognwrite-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "70184dc8ee157a847c59bc7f6275bf48",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3162,
"upload_time": "2022-12-01T08:48:37",
"upload_time_iso_8601": "2022-12-01T08:48:37.074217Z",
"url": "https://files.pythonhosted.org/packages/91/8a/a5e7a2985c6e050a4b021c1165f67782b556d13aaf36f576315197129cfe/lognwrite-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-01 08:48:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "malifpy",
"github_project": "log-n-write",
"lcname": "lognwrite"
}