mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-31 16:02:01 +08:00
Avoid name collisions for log_t types
This commit is contained in:
parent
379cb8cb86
commit
dc4692e098
@ -8,7 +8,7 @@
|
||||
#include <boost/locale.hpp>
|
||||
#include <boost/algorithm/string/case_conv.hpp>
|
||||
|
||||
#include "Log.hpp"
|
||||
#include "libslic3r/Log.hpp"
|
||||
|
||||
/// Local class to suppress output
|
||||
class NullStream : public std::streambuf
|
||||
@ -164,7 +164,7 @@ std::ostream& _Log::debug(const char topic[], bool multiline) {
|
||||
}
|
||||
|
||||
std::ostream& _Log::debug(const std::string& topic, bool multiline) {
|
||||
if (this->_has_log_level(log_t::DEBUG) && this->_has_topic(topic)) {
|
||||
if (this->_has_log_level(log_t::DBG) && this->_has_topic(topic)) {
|
||||
if (!multiline)
|
||||
_out << topic << std::setfill(' ') << std::setw(6) << "DEBUG" << ": ";
|
||||
return _out;
|
||||
@ -199,7 +199,7 @@ void _Log::set_level(log_t level) {
|
||||
this->_log_level.insert(log_t::ERR);
|
||||
this->_log_level.insert(log_t::WARN);
|
||||
this->_log_level.insert(log_t::INFO);
|
||||
this->_log_level.insert(log_t::DEBUG);
|
||||
this->_log_level.insert(log_t::DBG);
|
||||
} else {
|
||||
this->_log_level.insert(level);
|
||||
}
|
||||
|
@ -8,11 +8,10 @@
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
/// All available logging levels.
|
||||
enum class log_t : uint8_t { FERR = 0, ERR = 4, WARN = 8, INFO = 16, DEBUG = 32, ALL = 255 };
|
||||
enum class log_t : uint8_t { FERR = 0, ERR = 4, WARN = 8, INFO = 16, DBG = 32, ALL = 255 };
|
||||
|
||||
inline bool operator>(const log_t lhs, const log_t rhs) { return static_cast<uint8_t>(lhs) > static_cast<uint8_t>(rhs); }
|
||||
inline bool operator<(const log_t lhs, const log_t rhs) { return static_cast<uint8_t>(lhs) < static_cast<uint8_t>(rhs); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user