No project description provided
Project description
Rusty Logger
Simple, opinionated and blazingly fast python logging. Rusty-Logger
is a thin python wrapper for Rust's
tracing
library that provides minimal features for those that just want to log without crazy configurations.
Table of contents
Supported Configuration
Arg | Description | Default |
---|---|---|
stdout |
Log to stdout | True |
stderr |
Log to stderr | False |
filename |
Log to file | None |
level |
Level to log | INFO |
app_env |
Application environment (APP_ENV env var) | development |
time_format |
Custom time format for logger | [year]-[month]-[day]T[hour repr:24]:[minute]:[second]::[subsecond digits:4] |
json_config |
JsonCofig |
None |
json_config.flatten |
Whether to flatten any passed fields | True |
Constraints
Time is currently limited to UTC; however, you can customize time format to your liking using the time_format
arg. Please refer to (time docs)[https://time-rs.github.io/book/api/format-description.html] for formatting guidelines. In addition, because Rusty-Logger
calls Rust
directly, it's not currently possible to pull the specific line number where logging takes place unless python is directly used (if you're even interested in this feature :smile:). If you'd like to see this feature implemented, and you want to contribute, please refer to the contributing guide.
Additional Metadata
You may also pass additional metadata along with any logging messages via the LogMetadata
class, which takes a Dict[str, str]
as an argument.
Show Me The Code!
Basic Usage
from rusty_logger import Logger
logger = Logger.get_logger(__file__)
logger.info("his palms are sweaty")
output
2023-09-15T20:16:31.985449Z INFO his palms are sweaty app_env="development" name="your_file.py"
JSON
from rusty_logger import Logger, LogConfig, JsonConfig
logger = Logger.get_logger(__file__, LogConfig(json_config=JsonConfig()))
logger.info("knees weak")
output
{"timestamp":"2023-09-15T20:19:52.182299Z","level":"INFO","message":"knees weak","app_env":"development","name":"your_file.py"}
Log to file
from rusty_logger import Logger, LogConfig, JsonConfig, LogLevel
logger = Logger.get_logger(
name=__file__,
config=LogConfig(
stdout=False,
level=LogLevel.WARN,
filename="log/test.log",
json_config=JsonConfig(),
),
)
logger.warning("arms are heavy")
output from log/test.log
{"timestamp":"2023-09-15T20:23:37.461645Z","level":"WARN","message":"arms are heavy","app_env":"development","name":"your_file.py"}
Adding some metadata
from rusty_logger import Logger, LogConfig, JsonConfig, LogMetadata
logger = Logger.get_logger(__file__, LogConfig(json_config=JsonConfig()))
metadata = LogMetadata(data={"there's": "vomit"})
logger.info("on his sweater already", metadata=metadata)
output
{"timestamp":"2023-09-15T20:27:29.013887Z","level":"INFO","message":"on his sweater already","app_env":"development","name":"your_file.py","info":"{\"there's\": \"vomit\"}"}
Record multiple places at once
from rusty_logger import Logger, LogConfig, JsonConfig, LogMetadata, LogLevel
logger = Logger.get_logger(
__file__,
LogConfig(
stdout=True,
level=LogLevel.ERROR,
filename="logs/test.log",
json_config=JsonConfig(),
),
)
logger.error("MOM'S SPAGHETTI!")
output
{"timestamp":"2023-09-15T20:32:23.417027Z","level":"ERROR","message":"MOM'S SPAGHETTI!","app_env":"development","name":"your_file.py"}
Performance
Why would we do this when python logging is fine? Because we wanted something faster :smile:. From our own benchmarks, Rusty-Logger
tends to be ~4x
faster than vanilla python logging when logging to file and 20-50x
faster when logging to stdout. And while speed may not be mission critical for a few thousands logs, it can be for millions, which many companies deal with on a daily basis. Time is money and compute, and we want to save you both :moneybag: :computer:.
Contributing
While Rusty-Logger
is production ready out of the box, it is still in it's infancy and is ripe for additional contributions. If you'd like to contribute, please see the contributing guide.
Thank You!!! :heart: :heart: :heart:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for rusty_logger-0.1.0rc2-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c32b5db0d518756f741b7153e5ccb3a5a56a41edf1628d18d3058f3faa05e838 |
|
MD5 | be05e50237662b4dbe3ccfeb765877ae |
|
BLAKE2b-256 | 22c8cb52851b84ca191bba88ff25f01e97bb5750a733fa08276374c738995938 |
Hashes for rusty_logger-0.1.0rc2-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 299184b20c703be3b9b26888f9bcce36b308a37ddd8acbc5e603f646b29fec68 |
|
MD5 | 03d10999dba978cd5f20f28f9eb1e000 |
|
BLAKE2b-256 | 3f44c6eb97cd77deb3554bf72d6215dbf75b50fc4014cba1f2d55f1827483416 |
Hashes for rusty_logger-0.1.0rc2-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a3aab668338fd68319b32a1c15e7b983ebc9528684611f833c0d8663e4253bf |
|
MD5 | ada59ee9ad31a93dc29b29350d587974 |
|
BLAKE2b-256 | dc18d2e0cecfcb0fe76c14d6328196f63ce0ef0facca41ff032d441bdb3a5900 |
Hashes for rusty_logger-0.1.0rc2-cp311-cp311-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dee31cd89c49ee4dad0a160f1d750d61c1147fd02807e562eb1a8b80da7d519 |
|
MD5 | 2158c24953cf2db08cb3de9a35d8adb5 |
|
BLAKE2b-256 | d65ea070ebbeef1abe65093158c76f5bb915fa1e8b8526abc92f6813434e0b5c |
Hashes for rusty_logger-0.1.0rc2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ba52c730b6f688d85a9fbc97718fe2af7dd709885468446020aee590da9a2ff |
|
MD5 | 30c66b10a0b3899d7b4ebfb0244b0ea8 |
|
BLAKE2b-256 | ebe80fd6aeb8674f74135b3117751355d40a570aef9a904ab489aff593a2582f |
Hashes for rusty_logger-0.1.0rc2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf473ac080fa373cbd61d2f680df22ebd6283ea4c515fdfe03aae362e5adef24 |
|
MD5 | 80ba4b4f7293eebec36c044ac74eab79 |
|
BLAKE2b-256 | 2ef4274318f3e53a5d9bd27ef5b8228b4e5fbeead534fa86d3233702f2395afe |
Hashes for rusty_logger-0.1.0rc2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63fc5ba33525803162594a0a6ab1d43b56abe2f413e4bdc11faacdb7c0933512 |
|
MD5 | 8bd36cc6e4987b7c2a2c322fc8e079c2 |
|
BLAKE2b-256 | 513965c86e7c03dfadebfd22f71317cb50708ca95bcc6037da7ba78c79087528 |
Hashes for rusty_logger-0.1.0rc2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0d3cfed32707dd4dcf44db9c9fa06aab234fc3c79aaf6707e559add9fe673fb |
|
MD5 | ceb30ec04e9b8bf716009510ceb76f1b |
|
BLAKE2b-256 | c72a24e86a85861642e8f0da5388f80c404d02ae95655a69b981c4f7c11914aa |
Hashes for rusty_logger-0.1.0rc2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61ad360e7857f6874e96f82b5772f4a569c70d37e09417c8110de73420cdcb6d |
|
MD5 | 88cf2e562063d0336dade1ad72e1b703 |
|
BLAKE2b-256 | e9678ddc0496a7d0f30a150caedd31144d412e575a59a15e0f4eb22a70c60b6b |
Hashes for rusty_logger-0.1.0rc2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 702f3d8278a25e5ebbae68b2124734639524a6ea2336d81d1aff53ea336255f4 |
|
MD5 | d0bd324b77fea5a900300f115eaeb7bd |
|
BLAKE2b-256 | 3a3051694fde47d1bbbb2b5b8c7745177fa99ce1f8c772a4ccff61bb24643cf9 |
Hashes for rusty_logger-0.1.0rc2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54007ca5a47ea0cba6d8eb07e4aaa5177e2c2f146712427df773d8ba081cc1e6 |
|
MD5 | c5f5b37b1ced06aa7c442ac62c8f5d7b |
|
BLAKE2b-256 | d52b461f474633afede5d4e05f4baa3f3b2e20dee70560102131f96fd83efa94 |
Hashes for rusty_logger-0.1.0rc2-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4875fb3cdc33362e1bdfbe8aca803fc92a44c3d33dd47ce753599cb0c4c3116b |
|
MD5 | bf6e0dae7af0c1581938a5619b839f73 |
|
BLAKE2b-256 | f63d10b4f816b3d8a0af3eb36ffbef9db22552c812b4dbd74718607dca414020 |
Hashes for rusty_logger-0.1.0rc2-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14bd80483068ec79105e8945ac7abee3e934e1371c0d13d03622ff2fa26f294d |
|
MD5 | 18827f73e89ed3396311c1c055a6c4c0 |
|
BLAKE2b-256 | 135b80bfb8b5fc06146c4e614acaf3944467301f221a347bba371567d512e285 |
Hashes for rusty_logger-0.1.0rc2-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5468f8d1026c277917a891a4971b7a985bd9584f10565804257f3e1bb03b23f6 |
|
MD5 | 046e9d72ba05fcd0d40d85e04fe3d970 |
|
BLAKE2b-256 | b09c9fab2e4b19cab545fde3e1cae5f9b5eb345e1c0133906ba59a3b13913913 |
Hashes for rusty_logger-0.1.0rc2-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d6cc2c3f3290bcb3c5c0d0b88de281b91e9fb7c45a0a07664ae242382963f03 |
|
MD5 | 49759b33b9bbcf8ba95f9fa05d143976 |
|
BLAKE2b-256 | 4716f816abaa49e7a317a27569d5208f3d901b8246b30470b87f54dc065451be |
Hashes for rusty_logger-0.1.0rc2-cp310-cp310-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35586cb86d1f411d92a49ed175939f1553fbd32c145d17375b538a2649399552 |
|
MD5 | 56d94bf416c0692433ceaab433c7f027 |
|
BLAKE2b-256 | 87edf0750b169f9cd7971413d7ce5eea4effc6e71ee23f5cd4e99cea90ac450c |
Hashes for rusty_logger-0.1.0rc2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06a9147c2ae5ae9d5949fcb8f652d0105b3d1609afdc35bb90ae713950351a6c |
|
MD5 | 40273302885e6a23d42819815841bd27 |
|
BLAKE2b-256 | 1434d53813e3b7661f7ac2aab3184c7bf4748fb90af77c241c5e64feec90fe01 |
Hashes for rusty_logger-0.1.0rc2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ffaddd44eaaffa686df82160b715f5ca1a42f92c132a2a514216569a7cdaacc |
|
MD5 | 1b513721f93809426500633d5398bba4 |
|
BLAKE2b-256 | b572741e4922537255bb5f6bd40c875d14597741328b06c6fe99b05c7bf3d46a |
Hashes for rusty_logger-0.1.0rc2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efd44827efa8fbc3f1c1cfbf15979367da17f351edebecf941b4047b78c3ab2a |
|
MD5 | 6a35cd11a3a2fc934bf525e6a9c64a93 |
|
BLAKE2b-256 | 3ad42767e74e1adf4791fe838d9a817ea471f2e904c9992b0a37d9301b11825a |
Hashes for rusty_logger-0.1.0rc2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90c6e38752a7d160b09106b32d635447824985d62489720fabe3c5eafc64ebeb |
|
MD5 | 88104b0c28a9b96c2357804a1417a22b |
|
BLAKE2b-256 | b73f16f26c2d167fa0a5059e167da859218907b1aa5e44bd8b0645534b5f83b4 |
Hashes for rusty_logger-0.1.0rc2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e374a2fdae97834dda2582ddd17c9eec7397c337f299d5a5c7da4fee460f8c2c |
|
MD5 | 8022c0e4f10c221b972af320c9665651 |
|
BLAKE2b-256 | 0c597c3f6fc14bcb55ea2774807c3c0fd8721d6362154cef262163eb4accb7e0 |
Hashes for rusty_logger-0.1.0rc2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1347124a229b4634efde2c360d2fae5f9d2020370604090f32278c8cbdf75fc |
|
MD5 | 9bdeec1034b2d7c0757c41af0f204e94 |
|
BLAKE2b-256 | 11ce05d0c20e43f07f57ce8d9c4f70aafda814b8d902278d42a31f0329be5075 |
Hashes for rusty_logger-0.1.0rc2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ed9bce3b9cec7b731a53f3e8322f5fbe9378559af8227379dbef0c71332f715 |
|
MD5 | 0c27eb7ece1fd944024638dd26e60790 |
|
BLAKE2b-256 | 0c5dd9ed618d0ad7424b57c9ff890c17fa2411fbbe854f66e16c0a628c175ac3 |
Hashes for rusty_logger-0.1.0rc2-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af264432bf292006df1533baa4d3cbd9300226eef026d16f81ce4bc16ab7ffc2 |
|
MD5 | f2dd3c8988a3f4f99a7770b732c958c7 |
|
BLAKE2b-256 | f2fb5a494a844ca38d75a881edd34e5a5141174b1ed2674d86f1a672a1a3aaf0 |
Hashes for rusty_logger-0.1.0rc2-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1752cedbaa694736062ba789e0bb79a309b3aab8e7c2f9954c8690922bb9baf0 |
|
MD5 | 15129fafbecbc6ccf16f0240dcc9d7ef |
|
BLAKE2b-256 | 8a7e025df88f825cca8fecf00432c132f475b20ed1d596770d19fbb811c9b0d4 |
Hashes for rusty_logger-0.1.0rc2-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a989f9e8df4dc66c61cb3a74e2b02cc32887e432d63fc4de44fcfa2ab896742 |
|
MD5 | fbc0fd2d9b2f5843208a3227deef865e |
|
BLAKE2b-256 | 011753c2085d4b290b3e679153ad1a000c29aea236c6b936c72e7d29d82690bb |
Hashes for rusty_logger-0.1.0rc2-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34a72c38969d132becf325e994234d8477b1f93bcb6e536f20264b8d3c78e301 |
|
MD5 | a18763f7c42390186c8a1fed9c689b64 |
|
BLAKE2b-256 | 9e087747d5ca15c7290eb6b0e05253f0e4871d6fb61fb96cc103881670592b71 |
Hashes for rusty_logger-0.1.0rc2-cp39-cp39-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 328aecdc2436b79e2e9e06516aad626bdcea20065cce3eafe00164f14e3d5121 |
|
MD5 | 160678b799379e72ff1695720042357d |
|
BLAKE2b-256 | ea9b82baab7c7ae03695cdc6f91583839747f582712a248e24421f3b104f81d2 |
Hashes for rusty_logger-0.1.0rc2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8d61eb7692fdcd593a1b2e72d8cfe501899f1c0be052ef4787ccda332f8ca79 |
|
MD5 | a5cae12f8d4a26624a758811d20074b6 |
|
BLAKE2b-256 | 9dcf45e6256a7d643fcfc9a86c17af2687364f4f843076f998b8c2861c0cdb19 |
Hashes for rusty_logger-0.1.0rc2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01c91cbee3a9d554c648ec854776b2397ebdbbab9a15aa127192149a0fa29f74 |
|
MD5 | 5c363e7588c08d426642f4c806877b67 |
|
BLAKE2b-256 | d13747472896bfca34ea9886680352c949173aa42e552837796f2e1740ed1574 |
Hashes for rusty_logger-0.1.0rc2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cea6fe79e21c035699a4832aab9905dcce2d8b939b9016eaed6b32368243feb0 |
|
MD5 | 3f8691b9542d1ea4085536784099e7fa |
|
BLAKE2b-256 | 00da61f390223e41ab891d63cfc476abbd0c8a4ea765d28b1580a61b79921f25 |
Hashes for rusty_logger-0.1.0rc2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a9ff6a6c9df5ab36504f5f6643151747e47878e9a593fd93c12397d085fab5a |
|
MD5 | 309e88d9a39c341b46f4df93cc97fc28 |
|
BLAKE2b-256 | f41ef77012357788f3aef7992ed5673e0dd6b35106a4ac32da339a8ec1c77b55 |
Hashes for rusty_logger-0.1.0rc2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c752717495d0106f1fc10d600305c6ab6cd46d7fb157d57475a03b01ba29e3c |
|
MD5 | 247e6a116051d984af992a36badc7335 |
|
BLAKE2b-256 | a816d1632a7b4b0ece035bd0a388fe47dd06a626a4d1a0a6e925e2f4285c1f5d |
Hashes for rusty_logger-0.1.0rc2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 120185f105f714b82f6a21eb3abbf8842c7d1183ff44435f667c56a89539803b |
|
MD5 | ab6167575723b01c6a2d5fbe039f1a7f |
|
BLAKE2b-256 | 32bfccd21bac79846321e870a1d59171a6c5b0cbe0295b4b83ee9976c3c078ed |
Hashes for rusty_logger-0.1.0rc2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d11317af08f9406da084a56c6c5d18e2eb2063e35952b5c30dd677270c0022c |
|
MD5 | 4fd5602fd36fbd718cfbe799acbb206a |
|
BLAKE2b-256 | c2ecae70a2d2cb280bd20c3908947e9bab9c4864ae767a14a26a6e317591dff0 |
Hashes for rusty_logger-0.1.0rc2-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 080a9473a3f58d5c904502046629739b1a89ef06d77ef9be3b8aeb7490cbfe35 |
|
MD5 | ca706bc2e130e7c35a56b618d8867332 |
|
BLAKE2b-256 | f906b51c450f141026fedd9d38c54caaa2b8fc0e4c46034962fbd09e615f88ff |