# csmlog
[![Build Status](https://github.com/csm10495/csmlog/workflows/Release/badge.svg)](https://github.com/csm10495/csmlog/actions)
Package to setup a python logger the way I like to use it.
- By default logs to files per logger and one for the overall project
- Sets a master logger with sub loggers per file (obtained via getLogger())
## Usage
```
from csmlog import setup, getLogger
setup("appName") # call setup once whenever you would like to set the output location for future loggers
logger = getLogger(__file__)
# logger is a Python logger... feel free to use it.
# You should see logs in %APPDATA% on Windows and /var/log or ~/log on Linux/Mac
```
## Google Sheets Logging
`setup()` has an optional parameter: `googleSheetShareEmail`. If it is given, it should be an email address to share a Google Sheets worksheet of logs.
In order to use this, you must have a Google Service Account or User Account's credentials (in JSON form) in ~/.gcreds.json
Internally the gspread module is used for Google Sheets communication/authentication. See https://gspread.readthedocs.io/en/latest/oauth2.html for more information on getting credentials. The only thing different from their instructions is that for csmlog, the JSON credentials should be stored in ~/.gcreds.json.
Note that logs may be delayed due to rate limiting, etc. If you are logging *a lot*, it may not be a good idea to enable this feature.
## Customized Child Loggers
`setup()` has an optional parameter: `modifyChildLoggersFunc`. If it is given, it must be a function that would take in as a single arg, each created child logger. This can be used to add additional things like handlers to each child logger. (Note that the child logger is modified in place).
## Installation
```
pip install csmlog
```
Raw data
{
"_id": null,
"home_page": "http://github.com/csm10495/csmlog",
"name": "csmlog",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "csm10495",
"author_email": "csm10495@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/eb/d8/31703020eb8fe2f36d49d0ac3d2505360c5d3222f32efdbabd78804bc813/csmlog-0.28.0.tar.gz",
"platform": null,
"description": "# csmlog\n\n[![Build Status](https://github.com/csm10495/csmlog/workflows/Release/badge.svg)](https://github.com/csm10495/csmlog/actions)\n\nPackage to setup a python logger the way I like to use it.\n\n- By default logs to files per logger and one for the overall project\n- Sets a master logger with sub loggers per file (obtained via getLogger())\n\n## Usage\n\n```\nfrom csmlog import setup, getLogger\nsetup(\"appName\") # call setup once whenever you would like to set the output location for future loggers\nlogger = getLogger(__file__)\n\n# logger is a Python logger... feel free to use it.\n# You should see logs in %APPDATA% on Windows and /var/log or ~/log on Linux/Mac\n```\n\n## Google Sheets Logging\n`setup()` has an optional parameter: `googleSheetShareEmail`. If it is given, it should be an email address to share a Google Sheets worksheet of logs.\n\nIn order to use this, you must have a Google Service Account or User Account's credentials (in JSON form) in ~/.gcreds.json\n\nInternally the gspread module is used for Google Sheets communication/authentication. See https://gspread.readthedocs.io/en/latest/oauth2.html for more information on getting credentials. The only thing different from their instructions is that for csmlog, the JSON credentials should be stored in ~/.gcreds.json.\n\nNote that logs may be delayed due to rate limiting, etc. If you are logging *a lot*, it may not be a good idea to enable this feature.\n\n\n## Customized Child Loggers\n`setup()` has an optional parameter: `modifyChildLoggersFunc`. If it is given, it must be a function that would take in as a single arg, each created child logger. This can be used to add additional things like handlers to each child logger. (Note that the child logger is modified in place).\n\n## Installation\n```\npip install csmlog\n```\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "",
"version": "0.28.0",
"project_urls": {
"Homepage": "http://github.com/csm10495/csmlog"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7a46ba36a833422305b2a2384713710f149870b4ca2c4ff41a79ca031644768e",
"md5": "a264e59a38920201fb450ec0f5529f16",
"sha256": "c5e2ce1978e45c4044d071446d73f2d26b29ae15a7e09e82f778ac4c423149dc"
},
"downloads": -1,
"filename": "csmlog-0.28.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a264e59a38920201fb450ec0f5529f16",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 12410,
"upload_time": "2024-02-24T05:15:10",
"upload_time_iso_8601": "2024-02-24T05:15:10.317930Z",
"url": "https://files.pythonhosted.org/packages/7a/46/ba36a833422305b2a2384713710f149870b4ca2c4ff41a79ca031644768e/csmlog-0.28.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ebd831703020eb8fe2f36d49d0ac3d2505360c5d3222f32efdbabd78804bc813",
"md5": "0746922e334cc244d68f170ae4130718",
"sha256": "21c6460dadd4eaec6eb06003db0bb9a675099acf33f78740ef69594245b5ad15"
},
"downloads": -1,
"filename": "csmlog-0.28.0.tar.gz",
"has_sig": false,
"md5_digest": "0746922e334cc244d68f170ae4130718",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 11699,
"upload_time": "2024-02-24T05:15:12",
"upload_time_iso_8601": "2024-02-24T05:15:12.423677Z",
"url": "https://files.pythonhosted.org/packages/eb/d8/31703020eb8fe2f36d49d0ac3d2505360c5d3222f32efdbabd78804bc813/csmlog-0.28.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-24 05:15:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "csm10495",
"github_project": "csmlog",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "csmlog"
}