在Boost.Log文档中,据说是这样的
注意
库使用
basic_formatting_ostream流类型进行记录格式化,因此在自定义属性值格式化规则时,operator<<必须使用basic_formatting_ostream而不是std::ostream.
然而,在整个文档中,我看到的是超载operator <<的std::ostream,而不是basic_formatting_ostream在示例代码.例如,请在severity_level 此处查看自定义类型的重载.
根据我的测试,过载std::ostream和basic_formatting_ostream两者都很好.所以,我想知道在一个而不是另一个上重载的优点是什么.