mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-29 00:03:17 +00:00
Machine readable progress with -q and --log-format json
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user