Fix error when building with logging enabled