mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-02 11:29:01 +08:00
astyle
This commit is contained in:
@@ -32,10 +32,11 @@ public:
|
||||
const android_LogPriority priority = convert_to_android(msg.level);
|
||||
// See system/core/liblog/logger_write.c for explanation of return value
|
||||
const int ret = __android_log_write(
|
||||
priority, _tag.c_str(), msg.formatted.c_str()
|
||||
);
|
||||
if (ret < 0) {
|
||||
throw spdlog_ex("__android_log_write() failed", ret);
|
||||
priority, _tag.c_str(), msg.formatted.c_str()
|
||||
);
|
||||
if (ret < 0)
|
||||
{
|
||||
throw spdlog_ex("__android_log_write() failed", ret);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -35,8 +35,10 @@ protected:
|
||||
|
||||
void _sink_it(const details::log_msg& msg) override
|
||||
{
|
||||
for (auto &sink : _sinks){
|
||||
if( sink->should_log( msg.level)){
|
||||
for (auto &sink : _sinks)
|
||||
{
|
||||
if( sink->should_log( msg.level))
|
||||
{
|
||||
sink->log(msg);
|
||||
}
|
||||
}
|
||||
|
@@ -30,15 +30,18 @@ private:
|
||||
|
||||
};
|
||||
|
||||
inline bool sink::should_log(level::level_enum msg_level) const {
|
||||
inline bool sink::should_log(level::level_enum msg_level) const
|
||||
{
|
||||
return msg_level >= _level.load(std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
inline void sink::set_level(level::level_enum log_level) {
|
||||
inline void sink::set_level(level::level_enum log_level)
|
||||
{
|
||||
_level.store(log_level);
|
||||
}
|
||||
|
||||
inline level::level_enum sink::level() const {
|
||||
inline level::level_enum sink::level() const
|
||||
{
|
||||
return static_cast<spdlog::level::level_enum>(_level.load(std::memory_order_relaxed));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user