Home

Awesome

pblog - Protocol Buffer Log Library

alt text

pblog is a small, low overhead, structured logging library intended to be used to log firmware events. It is based on protobufs and uses the nanopb implementation in order to tackle object size concerns.

Dependencies

Runtime

Testing

For ubuntu systems these can all be installed with apt

apt install make protobuf-compiler python-protobuf

Building

make NANOPB_DIR=<NANOPB_SOURCE_DIR> all

if you don't already have nanopb you can

git clone https://github.com/nanopb/nanopb
make -C nanopb/generator/proto
make NANOPB_DIR=nanopb all

Installing

make NANOPB_DIR=<NANOPB_SOURCE_DIR> PREFIX=/usr install

Testing

make NANOPB_DIR=<NANOPB_SOURCE_DIR> GTEST_DIR=<GTEST_DIR> check

if you don't already have gtest you can run

git clone https://github.com/google/googletest
pushd "googletest" >/dev/null
cmake \
  -DCMAKE_INSTALL_PREFIX="$(pwd)/googletest" \
  -DMAKE_BUILD_TYPE=Release \
  -DBUILD_GTEST=ON -DBUILD_GMOCK=OFF
make
make install
popd >/dev/null
make NANOPB_DIR=<NANOPB_SOURCE_DIR> GTEST_DIR=googletest check

Use in a project

If you would like to build pblog into your project, we provide a makefile mk/pblog.mk which can be included.

The makefile depends on the following variables:

The makefile is guaranteed to export the following variables: