mschneider / solcpp

A fast Solana and Mango Markets C++ SDK
Other
40 stars 13 forks source link

use spdlog instead of std::cout #11

Closed papadpickle closed 2 years ago

papadpickle commented 2 years ago
papadpickle commented 2 years ago

This commit is just to present the style and look of logging done via spdlog as well as code formatting done via clang-tidy. Both are discretionary but can make life easier going forward.

spdlog is a pretty good logger, supporting the fmt as well as other options like file logging in case required in future. https://github.com/gabime/spdlog

i have just added to account subscribe example for the moment. in case the pr is accepted, we can proceed with other files. this is how the logging may look. image

mschneider commented 2 years ago
  1. spdlog looks great
  2. clang-tidy is a hassle to install on mac, recommend to go with clang-format as a start (which is widely available). Happy to switch to google code style. Please include a .clang-format config file and add a ci-check that enforces the code style on github actions.

Probably best to do both in separate PRs, so we can continue merging more work in between.

papadpickle commented 2 years ago

cool, ill split the stuff and raise seperate PRs.