MIT License

项目介绍

bodgergely/spdlog-python 是一个托管在 GitHub 上的开源项目,主要使用 C++ 编写,采用 MIT License 许可证,目前获得 76 个 Star、22 次 Fork。

仓库全名
bodgergely/spdlog-python
开源许可证
MIT License
Star 数
76
Fork 数
22
未关闭 Issue
10

README 摘要

spdlog-python ============= python wrapper around the fast C++ logger called spdlog Introduction ============ Python wrapper (pybind11) around the C++ spdlog logging library. Why choose spdlog? https://kjellkod.wordpress.com/2015/06/30/the-worlds-fastest-logger-vs-g3log/ Try running tests/spdlogvslogging.py and see what results you get on your system. spdlog-python vs logging (standard lib) How many microseconds it…

完整内容见 GitHub 原始 README 或本页 。

常见问题

spdlog-python 用什么语言开发?

主要使用 C++ 编写,采用 MIT License 许可证,目前有 76 个 Star。

spdlog-python 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 spdlog-python 的源码?

可以直接克隆仓库:git clone https://github.com/bodgergely/spdlog-python.git,默认分支为 master;安装与运行步骤见仓库 README。

spdlog-python 最近还在维护吗?

仓库最近一次更新为 2024年5月20日,当前有 10 个未关闭 Issue;Star 数为 76,可作为社区活跃度的参考。

关于

python wrapper around C++ spdlog ([email protected]:gabime/spdlog.git)

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
124
价值分
52
活跃状态
活跃

语言占比

C++
Python
Shell

README

Build Status

spdlog-python

python wrapper around the fast C++ logger called spdlog

Introduction

Python wrapper (pybind11) around the C++ spdlog logging library.

Why choose spdlog?

https://kjellkod.wordpress.com/2015/06/30/the-worlds-fastest-logger-vs-g3log/

Try running tests/spdlog_vs_logging.py and see what results you get on your system.

spdlog-python vs logging (standard lib)

How many microseconds it takes on average to complete a log function (info(), debug() etc) using a FileLogger. On reasonable sized log messages spdlog takes 4% (async mode enabled) and 6% (sync mode) of the time it would take to complete using the standard logging module.

Async mode with 8MB queue with blocking mode.

msg len (bytes) spdlog sync (microsec) spdlog async (microsec) logging (microsec)
10 1.2 0.87 24.6
100 1.2 1.03 24.6
300 1.5 1.07 24.9
1000 2.4 1.16 26.8
5000 6.2 2.31 31.7
20000 15.3 7.51 48.0

Installation

  1. pip install spdlog will get a distribution from pypi.org

or

  1. from github:

pip install pybind11 - if missing

git clone https://github.com/bodgergely/spdlog-python.git
cd spdlog-python
git submodule update --init --recursive
python setup.py install

Usage

./python
import spdlog as spd
logger = spd.FileLogger('fast_logger', '/tmp/spdlog_example.log')
logger.set_level(spd.LogLevel.INFO)
logger.info('Hello World!')
logger.debug('I am not so important.')

To run the speed test:

python ./tests/spdlog_vs_logging.py

评论

暂无评论