Circular buffer logging library, and utilities