Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.
/ pblog Public archive

Pblog is a small, low overhead, structured logging library

License

Notifications You must be signed in to change notification settings

google/pblog

Repository files navigation

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

  • c++ compiler

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:

  • NANOPB_DIR: The directory containing the source code for nanopb
  • PBLOG_BUILD_STATIC: Whether or not we should build a static pblog
  • PBLOG_BUILD_SHARED: Whether or not we should build a shared pblog

The makefile is guaranteed to export the following variables:

  • PBLOG_LIBRARIES: The targets from the enabled pblogging libraries
  • PBLOG_STATIC: The target for the static pblog library
  • PBLOG_SHARED: The target for the shared pblog library

About

Pblog is a small, low overhead, structured logging library

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published