MCPcopy Create free account
hub / github.com/LASzip/LASzip / LASMessage

Function LASMessage

src/lasmessage.cpp:98–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98void LASMessage(LAS_MESSAGE_TYPE type, LAS_FORMAT_STRING(const char*) fmt, ...) {
99 assert(type <= LAS_FATAL_ERROR); // message type must be less than or equal to LAS_FATAL_ERROR (LAS_QUIET must not be used in LASMessage calls)
100
101 lasmessage_cnt[type]++;
102
103 if (type < las_message_level) return;
104
105 bool clear_log_entry = false;
106 va_list args;
107 va_start(args, fmt);
108 char buffer[LAS_MAX_MESSAGE_LENGTH];
109 buildMessage(buffer, type, fmt, args);
110 va_end(args);
111
112 if (current_msg != fmt) {
113 if (rep_log_msg > max_rep_log_msg) {
114 std::string rep_msg = "(log message repeated " + std::to_string(rep_log_msg) + " times)";
115 (*message_handler)(LAS_INFO, rep_msg.c_str(), message_user_data);
116 }
117 // message template (unformatted message)
118 current_msg = fmt;
119 rep_log_msg = 1;
120 } else {
121 ++rep_log_msg;
122 }
123
124 if (rep_log_msg <= max_rep_log_msg) {
125 (*message_handler)(type, buffer, message_user_data);
126 }
127}
128
129/// Reduces repetitive log messages and summarises them.
130/// On the one hand, both formatted and unformatted messages (arguments inserted and not) are collected.

Callers 15

laserrorFunction · 0.85
laserrormFunction · 0.85
completeMethod · 0.85
printMethod · 0.85
merge_intervalsMethod · 0.85
~LASMessageStreamMethod · 0.85
laszip_read_headerFunction · 0.85
set_classification_intFunction · 0.85
~IntegerCompressorMethod · 0.85
LASLIB_DLL byebyeFunction · 0.85

Calls 1

buildMessageFunction · 0.85

Tested by

no test coverage detected