Skip to main content

agarilog

PyPI version Python versions

This is simple logger for message service.

想定用途

長時間のバッチ処理やサービスのデモなどのloggerを想定。
他から呼ばれることを想定したライブラリなどには向きません。

Installation

pip install agarilog

Features

Use .env file.

>>> import agarilog as logger
>>> logger.info("Hello agarilog!")

Use any .env file.

>>> from agarilog import get_logger
>>> logger = get_logger(name=__name__, env_file="dev.env")
>>> logger.info("Hello agarilog!")

This is use dev.env file.

Telegram

https://github.com/sakuv2/agarilog/blob/main/img/telegram_sample.png?raw=true

Slack

https://github.com/sakuv2/agarilog/blob/main/img/slack_sample.png?raw=true

Chatwork

https://github.com/sakuv2/agarilog/blob/main/img/chatwork_sample.png?raw=true

Terminal

https://github.com/sakuv2/agarilog/blob/main/img/terminal_sample.png?raw=true

Environment

環境変数にサービスごとの設定を登録する。
もしくは実行パスと同じ場所の .env ファイルに記述する。
importの方法を変えることで任意のファイルを読み込むこともできる。(上記参照)
web系の設定は LOG_XXXX_LIMIT を用いて並列で送信するログの数に制限をかけられる。
1に設定することで、ログの順序通りに送信できる。それ以上は順序は保証されない。

Environment variables will always take priority over values loaded from a dotenv file.

LOG_XXXX_LEVEL: [“NOTSET”, “DEBUG”, “INFO”, “WARNING”, “ERROR”, “CRITICAL”]

Telegram

LOG_TELEGRAM_TOKEN=XXXXXXXXX:YYYYYYYYYYYYYYYYYYYYYYYYYYYY
LOG_TELEGRAM_CHAT_ID=XXXXXXXX
LOG_TELEGRAM_LEVEL=WARNING # default is warning
LOG_TELEGRAM_LIMIT=10 # default is 10

Slack

LOG_SLACK_TOKEN=xxxx-YYYYYYYYYYYY-YYYYYYYYYYYY-xxxxxxxxxxxxxxxxxxxxx
LOG_SLACK_CHANNEL=XXXXXXXXXXX
LOG_SLACK_LEVEL=WARNING # default is warning

Chatwork

LOG_CHATWORK_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
LOG_CHATWORK_ROOM_ID=XXXXXXXXX
LOG_CHATWORK_LEVLE=WARNING # default is warning

Terminal

LOG_TERMINAL_TYPE=COLOR # default is COLOR
LOG_TERMINAL_LEVEL=WARNING # default is warning

LOG_TERMINAL_TYPE: [“NONE”, “PRINT”, “NORMAL”, “COLOR”]

Development

git clone したら最初に実行すること。
仮想環境作成と pre-commit のインストールが行われる。
$ make init

Metadata

Release files for agarilog 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agarilog 0.2.1
File Size Uploaded Provenance Actions
agarilog-0.2.1.tar.gz 9.8 kB Without provenance Details for agarilog-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agarilog 0.2.1
File Interpreter ABI Platform Actions
agarilog-0.2.1-py3-none-any.whl Python 3 none any Details for agarilog-0.2.1-py3-none-any.whl

Total release size: 21.0 kB

Release files / agarilog-0.2.1.tar.gz

Download URL agarilog-0.2.1.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e1488eed2b90fb30b2850581e2b52e0a1d46465b864c61a812a8786492ebf58d
BLAKE2b-256 checksum
How to use checksums
9bc2450a4b79755d4d6e3e681645d861878dcb0038dfdfd8e70059a1a7c48fe5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.2 CPython/3.7.0 Darwin/19.6.0

Release files / agarilog-0.2.1-py3-none-any.whl

Download URL agarilog-0.2.1-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fe888a5005154d47b6d3bc45f7b3823e1ad84b423d6c5df72be64eb1fb0410d
BLAKE2b-256 checksum
How to use checksums
42a98f6db7fdc2185f6a4232fddb8aa73556a5a7238be51a9f582da3be4e4d78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.2 CPython/3.7.0 Darwin/19.6.0

Security for agarilog 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page