MIT License

项目介绍

roq-trading/roq-logging 是一个托管在 GitHub 上的开源项目,主要使用 C++ 编写,采用 MIT License 许可证,目前获得 9 个 Star、2 次 Fork。

仓库全名
roq-trading/roq-logging
开源许可证
MIT License
Star 数
9
Fork 数
2

README 摘要

roq-logging Logging utilities. Operating Systems Linux Library/Package Dependencies Abseil (Apache 2.0 License) ctre (Apache 2.0 License) fmt (MIT License) spdlog (MIT License) Optional Catch2 (Boost Software License 1.0 License) Prerequisites The project is designed to be compatible with the conda package manager. Building Installing A pre-compiled binary package can be downloaded from Roq's conda package…

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

常见问题

roq-logging 用什么语言开发?

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

roq-logging 可以免费商用吗?

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

如何获取 roq-logging 的源码?

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

roq-logging 最近还在维护吗?

仓库最近一次更新为 3 周前,当前没有未关闭的 Issue;Star 数为 9,可作为社区活跃度的参考。

关于

C++ logging utilities.

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

简要分析

热度分
15
价值分
6
活跃状态
活跃

语言占比

Batchfile
C++
CMake

贡献者

README

roq-logging

Logging utilities.

Operating Systems

  • Linux

Library/Package Dependencies

Optional

  • Catch2 (Boost Software License 1.0 License)

Prerequisites

The project is designed to be compatible with the conda package manager.

wget -N https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh

bash Miniforge3-Linux-x86_64.sh -b -u -p ~/conda

source ~/conda/bin/activate

conda install -y \
    git \
    cmake \
    gxx_linux-64 \
    abseil-cpp \
    fmt \
    spdlog

conda install -y --channel https://roq-trading.com/conda/stable \
    roq-oss-ctre \
    roq-api

Building

git submodule update --init --recursive

cmake .

make -j4

make test

Installing

A pre-compiled binary package can be downloaded from Roq’s conda package repository

conda install -y --channel https://roq-trading.com/conda/stable \
    roq-logging

Using

#include <cstdlib>

#include "roq/logging.h"

void foo(int i) {
  // only log when the ROQ_v environment variable has been set to 1 (or higher)
  VLOG(1)("enter foo")

  // always log
  LOG(INFO)("foo called with i={}", i);

  // conditional log a warning
  LOG_IF(WARNING, i > 10)("value exceeds threshold");

  // terminate the process with a stacktrace
  LOG(FATAL)("something is wrong");
}

int main(int argc, const char *argv[]) {
  roq::Logger::initialize(argv[0]);
  foo(argc);
  roq::Logger::shutdown();
  return EXIT_SUCCESS;
}

Acknowledgements

The interface is somewhat inspired by

  • glog (BSD 3-Clause License)

License

The project is released under the terms of the MIT license.

评论

暂无评论