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

Function LASMessage

LASzip/src/lasmessage.cpp:98–126  ·  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 if (type >= 0 && type <= LAS_QUIET) lasmessage_cnt[type]++;
102
103 if (type < las_message_level) return;
104
105 va_list args;
106 va_start(args, fmt);
107 char buffer[LAS_MAX_MESSAGE_LENGTH];
108 buildMessage(buffer, type, fmt, args);
109 va_end(args);
110
111 if (current_msg != fmt) {
112 if (rep_log_msg > max_rep_log_msg) {
113 std::string rep_msg = "(log message repeated " + std::to_string(rep_log_msg) + " times)";
114 (*message_handler)(LAS_INFO, rep_msg.c_str(), message_user_data);
115 }
116 // message template (unformatted message)
117 current_msg = fmt;
118 rep_log_msg = 1;
119 } else {
120 ++rep_log_msg;
121 }
122
123 if (rep_log_msg <= max_rep_log_msg) {
124 (*message_handler)(type, buffer, message_user_data);
125 }
126}
127
128/// Reduces repetitive log messages and summarises them.
129/// On the one hand, both formatted and unformatted messages (arguments inserted and not) are collected.

Callers 15

mainFunction · 0.85
mainFunction · 0.85
open_report_outputFunction · 0.85
mainFunction · 0.85
print_attributeFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
runMethod · 0.85
check_geokeysMethod · 0.85

Calls 2

buildMessageFunction · 0.85
to_stringFunction · 0.85

Tested by

no test coverage detected