Machine readable progress with -q and --log-format json

This commit is contained in:
Thomas Krijnen
2018-05-12 20:12:25 +02:00
parent 589f4bda2e
commit 7786b89269
3 changed files with 157 additions and 71 deletions
+7 -1
View File
@@ -40,20 +40,26 @@
class IFC_PARSE_API Logger {
public:
typedef enum { LOG_NOTICE, LOG_WARNING, LOG_ERROR } Severity;
typedef enum { FMT_PLAIN, FMT_JSON } Format;
private:
static std::ostream* log1;
static std::ostream* log2;
static std::stringstream log_stream;
static Severity verbosity;
static const char* severity_strings[];
static Format format;
static boost::optional<IfcSchema::IfcProduct*> current_product;
public:
static void SetProduct(boost::optional<IfcSchema::IfcProduct*> product);
/// Determines to what stream respectively progress and errors are logged
static void SetOutput(std::ostream* l1, std::ostream* l2);
/// Determines the types of log messages to get logged
static void Verbosity(Severity v);
static Severity Verbosity();
/// Determines output format: plain text or sequence of JSON objects
static void OutputFormat(Format f);
static Format OutputFormat();
/// Log a message to the output stream
static void Message(Severity type, const std::string& message, IfcEntityInstanceData* entity=0);