# python setup.py sdist bdist_wheel
# twine upload dist/*
from awslogger import CloudWatchLogger
import logging
# Replace 'your_aws_key' and 'your_aws_secret' with actual values
# Create an instance of the CloudWatchLogger class
logger = CloudWatchLogger(ACCESS_KEY, SECRET_KEY, REGION_NAME)
logger.set_log_level(logging.ERROR) # Set logging level to INFO
log_group_name = 'my-log-group'
log_stream_name = 'my-log-stream'
logger.create_log_group(log_group_name)
logger.create_log_stream(log_group_name, log_stream_name)
function_name = 'Test function'
# # Log at different levels
logger.put_log_event(log_group_name, log_stream_name, "This is info message.", function_name, log_level=logging.INFO)
logger.put_log_event(log_group_name, log_stream_name, "This is debug message.", function_name, log_level=logging.DEBUG)
logger.put_log_event(log_group_name, log_stream_name, "This is warning message.", function_name, log_level=logging.WARNING)
logger.put_log_event(log_group_name, log_stream_name, "This is critical message.", function_name, log_level=logging.CRITICAL)
logger.put_log_event(log_group_name, log_stream_name, "This is error message.", function_name, log_level=logging.ERROR)
Raw data
{
"_id": null,
"home_page": "",
"name": "awscloudwatchlogger",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python,logger,cloudwatch",
"author": "Babasaheb Pinjar",
"author_email": "babasahebpinjar@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ed/38/8a5146b27a633f9b13351874b1e8afbade5f1c658ec9a345ef3d4cca24a6/awscloudwatchlogger-0.2.tar.gz",
"platform": null,
"description": "\r\n# python setup.py sdist bdist_wheel\r\n\r\n# twine upload dist/*\r\n\r\nfrom awslogger import CloudWatchLogger\r\n\r\nimport logging\r\n\r\n\r\n\r\n# Replace 'your_aws_key' and 'your_aws_secret' with actual values\r\n\r\n# Create an instance of the CloudWatchLogger class\r\n\r\nlogger = CloudWatchLogger(ACCESS_KEY, SECRET_KEY, REGION_NAME)\r\n\r\nlogger.set_log_level(logging.ERROR) # Set logging level to INFO\r\n\r\n\r\n\r\nlog_group_name = 'my-log-group'\r\n\r\nlog_stream_name = 'my-log-stream'\r\n\r\nlogger.create_log_group(log_group_name)\r\n\r\nlogger.create_log_stream(log_group_name, log_stream_name)\r\n\r\n\r\n\r\n\r\n\r\nfunction_name = 'Test function'\r\n\r\n\r\n\r\n# # Log at different levels\r\n\r\nlogger.put_log_event(log_group_name, log_stream_name, \"This is info message.\", function_name, log_level=logging.INFO)\r\n\r\nlogger.put_log_event(log_group_name, log_stream_name, \"This is debug message.\", function_name, log_level=logging.DEBUG)\r\n\r\nlogger.put_log_event(log_group_name, log_stream_name, \"This is warning message.\", function_name, log_level=logging.WARNING)\r\n\r\nlogger.put_log_event(log_group_name, log_stream_name, \"This is critical message.\", function_name, log_level=logging.CRITICAL)\r\n\r\nlogger.put_log_event(log_group_name, log_stream_name, \"This is error message.\", function_name, log_level=logging.ERROR)\r\n\r\n\r\n\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Logging into aws cloudwatch from python apps",
"version": "0.2",
"project_urls": null,
"split_keywords": [
"python",
"logger",
"cloudwatch"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "134acd5839dc2fb4eab4c1cee658d4350bc12a6dd94b7f89d3765a6e974c20a0",
"md5": "7d7393873442246d63e87a4cbe8f8193",
"sha256": "15bc461b964c7fcf4bae2c54f35e7118893b09d785303733ef3173c56598f026"
},
"downloads": -1,
"filename": "awscloudwatchlogger-0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7d7393873442246d63e87a4cbe8f8193",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3791,
"upload_time": "2024-02-27T06:08:37",
"upload_time_iso_8601": "2024-02-27T06:08:37.000384Z",
"url": "https://files.pythonhosted.org/packages/13/4a/cd5839dc2fb4eab4c1cee658d4350bc12a6dd94b7f89d3765a6e974c20a0/awscloudwatchlogger-0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ed388a5146b27a633f9b13351874b1e8afbade5f1c658ec9a345ef3d4cca24a6",
"md5": "e480d215a730c414311c10eaaf62b515",
"sha256": "631f83419c7cb8454e1739128206b17296b5ae397bac93716a9d86e255baab29"
},
"downloads": -1,
"filename": "awscloudwatchlogger-0.2.tar.gz",
"has_sig": false,
"md5_digest": "e480d215a730c414311c10eaaf62b515",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3415,
"upload_time": "2024-02-27T06:08:38",
"upload_time_iso_8601": "2024-02-27T06:08:38.942612Z",
"url": "https://files.pythonhosted.org/packages/ed/38/8a5146b27a633f9b13351874b1e8afbade5f1c658ec9a345ef3d4cca24a6/awscloudwatchlogger-0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-27 06:08:38",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "awscloudwatchlogger"
}