Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_log.hpp
1/*
2##############################################################################
3# file: ms_log.hpp #
4# 'msparser' toolkit #
5# Encapsulates a general-purpose error object that collects information #
6# about several consecutive erros #
7##############################################################################
8# COPYRIGHT NOTICE #
9# Copyright 1998-2018 Matrix Science Limited All Rights Reserved. #
10# #
11##############################################################################
12# $Archive:: /Mowse/ms_mascotresfile/include/ms_errors.hpp $ #
13# $Author: robertog@matrixscience.com $ #
14# $Date: 2024-08-27 16:16:41 +0100 $ #
15# $Revision: 5566e3f2f102c2aae2dea328044e0e4030755ddd | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
16# $NoKeywords:: $ #
17##############################################################################
18*/
19
20#ifndef MS_LOG_HPP
21#define MS_LOG_HPP
22
23
24#include <cstdarg>
25#include <vector>
26#include <string>
27#include <map>
28#include <set>
29#include <utility>
30
31namespace matrix_science {
38 class MS_MASCOTRESFILE_API ms_log
39 {
40 public:
42
47 enum msg_sev {
48 sev_fatal = 1,
49 sev_warn = 2,
50 sev_info = 3,
51 sev_debug1 = 4,
52 sev_debug2 = 5,
53 sev_debug3 = 6
54 };
55
57
127 typedef int msg_num_t;
128
129#ifndef SWIG
130 typedef struct {
131 ms_log::msg_sev severity;
132 ms_log::msg_num_t msgNum;
133 const char * pMsgText;
134 } msg_catalog_t;
135 typedef std::map<ms_log::msg_num_t, const msg_catalog_t *> catalog_map_t;
136#endif
137
138 static const msg_num_t LOGMSG_DBG1_NUM_PROCESSOR_GROUPS = 0x00010160;
139 static const msg_num_t LOGMSG_DBG3_HWLOC_TREE = 0x00010161;
140 static const msg_num_t LOGMSG_DBG3_HWLOC_GROUPS = 0x00010162;
141 static const msg_num_t LOGMSG_DBG3_AUTO_DETECT_NUM_THREAD = 0x00010163;
142 static const msg_num_t LOGMSG_DBG3_CALL_GET_CHIP_MFCTR = 0x00010164;
143 static const msg_num_t LOGMSG_DBG3_PROCESSOR_NAME = 0x00010165;
144 static const msg_num_t LOGMSG_DBG3_BINDING_PROCESSORS = 0x00010166;
145 static const msg_num_t LOGMSG_DBG3_BINDING_THREAD = 0x00010167;
146 static const msg_num_t LOGMSG_DBG2_NUM_CONFIG_MISMATCH = 0x00010168;
147 static const msg_num_t LOGMSG_DBG2_NUM_ONLINE_MISMATCH = 0x00010169;
148 static const msg_num_t LOGMSG_DBG2_CPU_INF_NUM_ON_SYS = 0x00010170;
149 static const msg_num_t LOGMSG_DBG2_CPU_INF_NUM_AVAIL = 0x00010171;
150 static const msg_num_t LOGMSG_DBG2_CPU_INF_NUM_GROUPS = 0x00010172;
151 static const msg_num_t LOGMSG_DBG2_CPU_INF_NAME = 0x00010173;
152 static const msg_num_t LOGMSG_DBG2_CPU_INF_PROC_AFFINITY = 0x00010174;
153 static const msg_num_t LOGMSG_DBG2_CPU_INF_USE_PROCESSES = 0x00010175;
154 static const msg_num_t LOGMSG_DBG2_CPU_INF_NUM_PHYSICAL = 0x00010176;
155 static const msg_num_t LOGMSG_DBG2_CPU_INF_LOGI_PER_PHYS = 0x00010177;
156 static const msg_num_t LOGMSG_DBG2_CPU_INF_CORE_PER_PHYS = 0x00010178;
157 static const msg_num_t LOGMSG_DBG2_CPU_INF_GETAUTODETECT = 0x00010179;
158 static const msg_num_t LOGMSG_DBG2_CPU_INF_MT_NAME = 0x0001017A;
159 static const msg_num_t LOGMSG_DBG2_CPU_INF_MT_STATUS = 0x0001017B;
160 static const msg_num_t LOGMSG_DBG2_CPU_INF_TABLE_TITLE = 0x0001017C;
161 static const msg_num_t LOGMSG_DBG2_CPU_INF_TABLE_LINE = 0x0001017D;
162
163 // Installer logging messages
164 static const msg_num_t LOGMSG_INST_LOGICALPERPHYSICALCPU = 0x00010200;
165 static const msg_num_t LOGMSG_INST_NUMTHREADS = 0x00010201;
166 static const msg_num_t LOGMSG_INST_NOTMASCOTDATOK = 0x00010202;
167 static const msg_num_t LOGMSG_INST_MASCOTDATOK = 0x00010203;
168 static const msg_num_t LOGMSG_INST_APPENDTAXONOMY = 0x00010204;
169 static const msg_num_t LOGMSG_INST_ADDINGDATABASE = 0x00010205;
170 static const msg_num_t LOGMSG_INST_CHANGEDBTAXONOMY = 0x00010206;
171 static const msg_num_t LOGMSG_INST_APPENDPARSERULE = 0x00010207;
172 static const msg_num_t LOGMSG_INST_ADDOPTIONSSECTION = 0x00010208;
173 static const msg_num_t LOGMSG_INST_SETOPTIONSSECTION = 0x00010209;
174 static const msg_num_t LOGMSG_INST_CLUSTERSECTION = 0x0001020A;
175 static const msg_num_t LOGMSG_INST_NOSUBCLUSTERSET = 0x0001020B;
176 static const msg_num_t LOGMSG_INST_CHANGEPARSERULE = 0x0001020C;
177 static const msg_num_t LOGMSG_INST_SAVEDPOSTINSTALLFILE = 0x0001020D;
178 static const msg_num_t LOGMSG_INST_FAILSAVEPOSTINSTALLFILE = 0x0001020E;
179 static const msg_num_t LOGMSG_INST_REMOVEOPTIONSSECTION = 0x0001020F;
180 static const msg_num_t LOGMSG_INST_CHANGEPERCOLATORFEATS = 0x00010210;
181 static const msg_num_t LOGMSG_INST_CHANGEPROTFAMILYSWITCH = 0x00010211;
182 static const msg_num_t LOGMSG_INST_CHANGEPERCOLATORUSERT = 0x00010212;
183 static const msg_num_t LOGMSG_INST_CHANGESPLITNUMOFQUERIES = 0x00010213;
184 static const msg_num_t LOGMSG_INST_CHANGESPLITDATAFILESIZE = 0x00010214;
185 static const msg_num_t LOGMSG_INST_CHANGERESULTSCACHE = 0x00010215;
186
187 static const msg_num_t LOGMSG_HTTP_URLSTRING = 0x00010300;
188 static const msg_num_t LOGMSG_HTTP_QUERYSTATUSRESULT = 0x00010301;
189 static const msg_num_t LOGMSG_HTTP_MAXCONECTIONSFAILED = 0x00010302;
190 static const msg_num_t LOGMSG_HTTP_MAXCONECTIONS10FAILED = 0x00010303;
191 static const msg_num_t LOGMSG_HTTP_GETRETURNSTRING = 0x00010304;
192
193
194 // Quantitation logging messages
195 static const msg_num_t LOGMSG_CUSTQUANT_ADD_QUANT_KEY = 0x00010400;
196 static const msg_num_t LOGMSG_CUSTQUANT_REMOVE_ALL_KEY = 0x00010401;
197 static const msg_num_t LOGMSG_CUSTQUANT_REMOVE_KEY = 0x00010402;
198 static const msg_num_t LOGMSG_QUANT_START_UPDATE_PROT_MATCHES = 0x00010403;
199 static const msg_num_t LOGMSG_QUANT_FINISH_UPDATE_PROT_MATCHES = 0x00010404;
200 static const msg_num_t LOGMSG_QUANT_START_CALC_COMPLETE = 0x00010405;
201 static const msg_num_t LOGMSG_QUANT_FINISH_CALC_COMPLETE = 0x00010406;
202 static const msg_num_t LOGMSG_QUANT_START_LOAD_CDB = 0x00010408;
203 static const msg_num_t LOGMSG_QUANT_FINISH_LOAD_CDB = 0x00010409;
204 static const msg_num_t LOGMSG_QUANT_LOAD_PEP_STATUS_MATCHES = 0x0001040A;
205 static const msg_num_t LOGMSG_QUANT_LOADING_MATCHES = 0x0001040B;
206 static const msg_num_t LOGMSG_QUANT_UPDATING_PEP_EVIDENCE = 0x0001040C;
207 static const msg_num_t LOGMSG_QUANT_REAPPLY_THRESHOLDS = 0x0001040D;
208 static const msg_num_t LOGMSG_QUANT_UPDATE_EXCLUDED_MATCHES = 0x0001040E;
209 static const msg_num_t LOGMSG_QUANT_CALC_COMPLETE_ON_MERGED = 0x0001040F;
210 static const msg_num_t LOGMSG_QUANT_REMATCHING_INFERRED = 0x00010410;
211 static const msg_num_t LOGMSG_QUANT_EXCLUDING_PEPTIDE = 0x00010411;
212 static const msg_num_t LOGMSG_QUANT_EXCLUDING_PEPTIDE_LESSTHAN = 0x00010412;
213 static const msg_num_t LOGMSG_QUANT_EXCLUDING_PEPTIDE_GREATHAN = 0x00010413;
214 static const msg_num_t LOGMSG_QUANT_REMOVE_MATCH_NO_EVIDENCE = 0x00010414;
215 static const msg_num_t LOGMSG_QUANT_REMOVE_INFERRED_MATCH = 0x00010415;
216 static const msg_num_t LOGMSG_QUANT_ADDING_PROTEIN_HIT = 0x00010416;
217 static const msg_num_t LOGMSG_QUANT_ADDED_PROTEIN_HIT = 0x00010417;
218 static const msg_num_t LOGMSG_QUANT_OPENING_CACHE_FILE = 0x00010418;
219 static const msg_num_t LOGMSG_QUANT_CLOSING_CACHE_FILE = 0x00010419;
220 static const msg_num_t LOGMSG_QUANT_START_REORDER_AFTER_MERGE = 0x0001041A;
221 static const msg_num_t LOGMSG_QUANT_FINISH_REORDER_AFTER_MERGE = 0x0001041B;
222 static const msg_num_t LOGMSG_QUANT_MERGE_COMPONENT_INCONSIST = 0x0001041C;
223 static const msg_num_t LOGMSG_QUANT_MERGE_COMPONENT_DUPE_FI = 0x0001041D;
224 static const msg_num_t LOGMSG_QUANT_MERGE_COMPONENT_SUCCESS = 0x0001041E;
225 static const msg_num_t LOGMSG_QUANT_TIME_ALIGN_INDEX_MZ_RANGE = 0x0001041F;
226 static const msg_num_t LOGMSG_QUANT_RT_OFFSET_LOOKUP = 0x00010420;
227 static const msg_num_t LOGMSG_QUANT_TIME_ALIGN_INDEX_MZ_RANGE1 = 0x00010421;
228
229
230 // ms_matrix (mathematical matrix, not matrix science) debugging
231 static const msg_num_t LOGMSG_MATRIX_OUTPUT_VALS = 0x00010500;
232
233 // ms_aahelper tracing
234 static const msg_num_t LOGMSG_AAHELPER_CFR_NUM_FRAGMENTS = 0x00010600;
235 static const msg_num_t LOGMSG_AAHELPER_REGULAR_ION_REJECT = 0x00010601;
236 static const msg_num_t LOGMSG_AAHELPER_REGULAR_ION_ADD = 0x00010602;
237 static const msg_num_t LOGMSG_AAHELPER_REGULAR_PRIME_ION_REJECT= 0x00010603;
238 static const msg_num_t LOGMSG_AAHELPER_REGULAR_PRIME_ION_ADD = 0x00010604;
239 static const msg_num_t LOGMSG_AAHELPER_IMMONIUM_ION_REJECT = 0x00010605;
240 static const msg_num_t LOGMSG_AAHELPER_IMMONIUM_ION_ADD = 0x00010606;
241 static const msg_num_t LOGMSG_AAHELPER_INTERNAL_ION_REJECT = 0x00010607;
242 static const msg_num_t LOGMSG_AAHELPER_INTERNAL_ION_ADD = 0x00010608;
243 static const msg_num_t LOGMSG_AAHELPER_CROSSLINKED_START = 0x00010609;
244 static const msg_num_t LOGMSG_AAHELPER_MULTINL_INDICES = 0x0001060A;
245 static const msg_num_t LOGMSG_AAHELPER_MASTER_NL_VALS = 0x0001060B;
246 static const msg_num_t LOGMSG_AAHELPER_TOTAL_NL_VALS = 0x0001060C;
247 static const msg_num_t LOGMSG_AAHELPER_CUMULATIVE_MASS_NL = 0x0001060D;
248 static const msg_num_t LOGMSG_AAHELPER_SERIES_PARAMS = 0x0001060E;
249 static const msg_num_t LOGMSG_AAHELPER_CALC_MASS_MAX_REACHED = 0x0001060F;
250 static const msg_num_t LOGMSG_AAHELPER_CALC_MASS_SKIP_D_PRIME_RES = 0x00010610;
251 static const msg_num_t LOGMSG_AAHELPER_CALC_MASS_SKIP_D_RESIDUE = 0x00010611;
252 static const msg_num_t LOGMSG_AAHELPER_CALC_MASS_SKIP_V_RESIDUE = 0x00010612;
253 static const msg_num_t LOGMSG_AAHELPER_CALC_MASS_SKIP_W_PRIME_RES = 0x00010613;
254 static const msg_num_t LOGMSG_AAHELPER_CALC_MASS_SKIP_W_RESIDUE = 0x00010614;
255 static const msg_num_t LOGMSG_AAHELPER_ETMOD_LOOKUP = 0x00010615;
256 static const msg_num_t LOGMSG_AAHELPER_SETUP_FROM_PRE2_2_INIT = 0x00010616;
257 static const msg_num_t LOGMSG_AAHELPER_SETUP_FROM_PRE2_2_ANYCHNG = 0x00010617;
258 static const msg_num_t LOGMSG_AAHELPER_CFR_START_FRAGMENTS = 0x00010618;
259 static const msg_num_t LOGMSG_AAHELPER_CROSSLINKED_END = 0x00010619;
260 static const msg_num_t LOGMSG_AAHELPER_CFR_SET_QUANT_COMPONENT = 0x0001061A;
261 static const msg_num_t LOGMSG_AAHELPER_CFR_MASSES_VALUE = 0x0001061B;
262 static const msg_num_t LOGMSG_AAHELPER_CFR_MOD_DELTA_AT_SITE = 0x0001061C;
263 static const msg_num_t LOGMSG_AAHELPER_CFR_INIT_VARMOD_IS_LINKER = 0x0001061D;
264 static const msg_num_t LOGMSG_AAHELPER_CFR_INIT_VARMOD_IS_MONOLINK = 0x0001061E;
265 static const msg_num_t LOGMSG_AAHELPER_CFR_LOOPLINKING_MASK = 0x0001061F;
266
267 // ms_proteininference tracing
268 static const msg_num_t LOGMSG_PROTINFER_FIND_FAMILY_START = 0x00010700;
269 static const msg_num_t LOGMSG_PROTINFER_FIND_FAMILY_QUEUE = 0x00010701;
270 static const msg_num_t LOGMSG_PROTINFER_FIND_FAMILY_REP_SEQS = 0x00010702;
271 static const msg_num_t LOGMSG_PROTINFER_PEPTIDE_MATRIX = 0x00010703;
272 static const msg_num_t LOGMSG_PROTINFER_FIND_FAMILY_END = 0x00010704;
273 static const msg_num_t LOGMSG_PROTINFER_GROUP_FAMILY_START = 0x00010705;
274 static const msg_num_t LOGMSG_PROTINFER_GROUP_FAMILY_SAMESET_PARENT_LIST = 0x00010706;
275 static const msg_num_t LOGMSG_PROTINFER_GROUP_FAMILY_SAMESET_LEAD_LIST = 0x00010707;
276 static const msg_num_t LOGMSG_PROTINFER_GROUP_FAMILY_DISCARDED_SL_LIST = 0x00010708;
277 static const msg_num_t LOGMSG_PROTINFER_GROUP_FAMILY_ELIMINATION = 0x00010709;
278 static const msg_num_t LOGMSG_PROTINFER_GROUP_FAMILY_ELIMINATION_MEMBER_LIST = 0x0001070A;
279 static const msg_num_t LOGMSG_PROTINFER_GROUP_FAMILY_ELIMINATION_LEAD_LIST = 0x0001070B;
280 static const msg_num_t LOGMSG_PROTINFER_GROUP_FAMILY_ELIMINATION_SUBSET_LIST = 0x0001070C;
281 static const msg_num_t LOGMSG_PROTINFER_ELIMINATE_INTERSECTIONS_FREE_COUNT_ZERO = 0x0001070D;
282 static const msg_num_t LOGMSG_PROTINFER_ELIMINATE_INTERSECTIONS_NEXT = 0x0001070E;
283 static const msg_num_t LOGMSG_PROTINFER_ELIMINATE_INTERSECTIONS_SUPERSET_LIST = 0x0001070F;
284 static const msg_num_t LOGMSG_PROTINFER_CHOOSE_NEXT_START = 0x00010710;
285 static const msg_num_t LOGMSG_PROTINFER_CHOOSE_NEXT_SUPERSET_EMPTY = 0x00010711;
286 static const msg_num_t LOGMSG_PROTINFER_CHOOSE_NEXT_SUPERSET_LIST = 0x00010712;
287 static const msg_num_t LOGMSG_PROTINFER_CHOOSE_NEXT_KEEP = 0x00010713;
288 static const msg_num_t LOGMSG_PROTINFER_REMOVE_CONFLICTING_START = 0x00010714;
289 static const msg_num_t LOGMSG_PROTINFER_REMOVE_CONFLICTING_KEEP = 0x00010715;
290 static const msg_num_t LOGMSG_PROTINFER_REMOVE_CONFLICTING_DISCARD = 0x00010716;
291 static const msg_num_t LOGMSG_PROTINFER_SORT_BY_SCORE_START = 0x00010717;
292 static const msg_num_t LOGMSG_PROTINFER_SORT_BY_SCORE_CREATE = 0x00010718;
293 static const msg_num_t LOGMSG_PROTINFER_SORT_BY_SCORE_CREATED = 0x00010719;
294 static const msg_num_t LOGMSG_PROTINFER_SORT_BY_SCORE_NO_PROTEINS = 0x0001071A;
295 static const msg_num_t LOGMSG_PROTINFER_SORT_BY_SCORE_REMOVE_MINPROTEINSCORE = 0x0001071B;
296 static const msg_num_t LOGMSG_PROTINFER_SORT_BY_SCORE_REMOVE_MAXHITS = 0x0001071C;
297 static const msg_num_t LOGMSG_PROTINFER_SORT_BY_SCORE_REMOVE_LONGESTPEPLEN = 0x0001071D;
298 static const msg_num_t LOGMSG_PROTINFER_SORT_BY_SCORE_REMOVE_LONGESTSIGPEPLEN = 0x0001071E;
299 static const msg_num_t LOGMSG_PROTINFER_SUBSET_STARTS_NEW_HIT = 0x0001071F;
300 static const msg_num_t LOGMSG_PROTINFER_SORT_BY_SCORE_REMOVE_CHECKBOLD = 0x00010720;
301 static const msg_num_t LOGMSG_PROTINFER_SORT_BY_SCORE_NEXT_PROTEIN = 0x00010721;
302 static const msg_num_t LOGMSG_PROTINFER_SORT_BY_SCORE_DONE = 0x00010722;
303 static const msg_num_t LOGMSG_PROTINFER_FIND_MATCHES_PROTEIN_START = 0x00010723;
304 static const msg_num_t LOGMSG_PROTINFER_FIND_MATCHES_SUBSET_START = 0x00010724;
305 static const msg_num_t LOGMSG_PROTINFER_FIND_MATCHES_PROTEIN_END = 0x00010725;
306 static const msg_num_t LOGMSG_PROTINFER_CLUSTER_FROM_ACC = 0x00010726;
307 static const msg_num_t LOGMSG_PROTINFER_GROUP_FROM_ACC = 0x00010727;
308 static const msg_num_t LOGMSG_PROTINFER_SINGLETON_FROM_ACC = 0x00010728;
309 static const msg_num_t LOGMSG_PEPSUM_GETHIT = 0x00010729;
310 static const msg_num_t LOGMSG_PROTINFER_NUM_PEPTIDES_IN_FAMILY = 0x0001072A;
311 static const msg_num_t LOGMSG_PROTINFER_GROUP_FAMILY_PULL_IN = 0x0001072B;
312
313 // ms_quant_helper tracing
314 static const msg_num_t LOGMSG_QUANT_HELPER_TEST_REQUIRED = 0x00010800;
315
316 // Generic tracing messages
317 static const msg_num_t LOGMSG_REPORT_FUNCTION_CALLED_BY = 0x00010900;
318 static const msg_num_t LOGMSG_REPORT_FUNCTION_ENTRY = 0x00010901;
319 static const msg_num_t LOGMSG_REPORT_FUNCTION_ENTRY_WITH_ARGS1 = 0x00010902;
320 static const msg_num_t LOGMSG_REPORT_FUNCTION_ENTRY_WITH_ARGS2 = 0x00010903;
321 static const msg_num_t LOGMSG_REPORT_FUNCTION_ENTRY_WITH_ARGS3 = 0x00010904;
322 static const msg_num_t LOGMSG_REPORT_FUNCTION_ENTRY_WITH_ARGS4 = 0x00010905;
323
324 static const msg_num_t LOGMSG_REPORT_FUNCTION_EXIT = 0x00010910;
325 static const msg_num_t LOGMSG_REPORT_FUNCTION_EXIT_WITH = 0x00010911;
326
327 // ms_mascotresfilebase or ms_mascotresults tracing
328 static const msg_num_t LOGMSG_RESFILE_APPEND = 0x00010A00;
329 static const msg_num_t LOGMSG_GET_THRESHOLD_FOR_FIRST_PASS_FDR = 0x00010A01;
330 static const msg_num_t LOGMSG_GET_THRESHOLD_FOR_FDR_FOR_ET = 0x00010A02;
331 static const msg_num_t LOGMSG_GET_THR_LOOP_BODY_START = 0x00010A03;
332 static const msg_num_t LOGMSG_GET_THR_LOOP_BODY_ZERO_COUNT = 0x00010A04;
333 static const msg_num_t LOGMSG_GET_THR_LOOP_BODY_MIN_FOUND = 0x00010A05;
334 static const msg_num_t LOGMSG_GET_THR_REACH_COND = 0x00010A06;
335 static const msg_num_t LOGMSG_NON_DEFAULT_HOMOLOGY_THRESHOLD = 0x00010A07;
336
337 static const msg_num_t LOGMSG_MSR2DAT28_SQL_TRACING = 0x00010B00;
338
339 public:
341 ms_log();
342
344 virtual ~ms_log();
345
346 public:
347#ifndef SWIG
348#if defined(_INTERNAL_USE_AND_HAVE_BOOST_FORMAT) || defined(DOXYGEN_SHOULD_SKIP_THIS)
349
351
358 void logMessage(ms_log::msg_num_t msgNum, const char * srcFile, const int lineNum) {
359 ms_log::msg_sev severity;
360 std::string unformattedMsg = _lookUpMsg(msgNum, severity);
361 _setError(static_cast<int>(msgNum), unformattedMsg.c_str(), severity, "", -1, lineNum, srcFile);
362 }
363
364
366 template <typename T1>
367 void logMessage(ms_log::msg_num_t msgNum, const char * srcFile, const int lineNum, T1 arg1);
368
370 template <typename T1, typename T2>
371 void logMessage(ms_log::msg_num_t msgNum, const char * srcFile, const int lineNum, T1 arg1, T2 arg2);
372
374 template <typename T1, typename T2, typename T3>
375 void logMessage(ms_log::msg_num_t msgNum, const char * srcFile, const int lineNum, T1 arg1, T2 arg2, T3 arg3);
376
378 template <typename T1, typename T2, typename T3, typename T4>
379 void logMessage(ms_log::msg_num_t msgNum, const char * srcFile, const int lineNum, T1 arg1, T2 arg2, T3 arg3, T4 arg4);
380
382 template <typename T1, typename T2, typename T3, typename T4, typename T5>
383 void logMessage(ms_log::msg_num_t msgNum, const char * srcFile, const int lineNum, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
384
386 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
387 void logMessage(ms_log::msg_num_t msgNum, const char * srcFile, const int lineNum, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
388
390 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
391 void logMessage(ms_log::msg_num_t msgNum, const char * srcFile, const int lineNum, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
392
394 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
395 void logMessage(ms_log::msg_num_t msgNum, const char * srcFile, const int lineNum, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
396
398 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
399 void logMessage(ms_log::msg_num_t msgNum, const char * srcFile, const int lineNum, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9);
400#endif
401#endif
402
404 virtual msg_sev getLoggingLevel() const = 0;
405
407 bool willMessageBeLogged(const msg_num_t msgNum) const;
408
410 std::string _lookUpMsg(const ms_log::msg_num_t msgNum, ms_log::msg_sev & severity) const;
411
413 ms_log::msg_sev getMessageSeverity(const ms_log::msg_num_t msgNum) const;
414
416 ms_loggingmonitor::Source_e getMessageSource(const ms_log::msg_num_t msgNum) const;
417
418#ifndef SWIG
419 enum errorOrLogMessages_e { MSG_LOG, MSG_ERR };
420
422 void addToCatalog(const msg_catalog_t catalog[], size_t numEntries, ms_loggingmonitor::Source_e src, errorOrLogMessages_e errorOrLogMessages);
423#endif
424
425 protected:
426 virtual void _setError(const int /* ms_errs::err*/ errorNum,
427 const char* strBuffer,
428 const msg_sev severity,
429 const std::string & sessionID = "",
430 const int userID = -1,
431 const int srcLineNumber = -1,
432 const char * srcFileName = "") = 0;
433
434 private:
435 typedef std::pair<ms_loggingmonitor::Source_e, errorOrLogMessages_e> msgsSrcAndType_t;
436 catalog_map_t& getGlobalCatalog() const;
437 std::set<msgsSrcAndType_t>& getGlobalAddedToCatalog() const;
438 }; // class ms_log
439 // end of error_handling_group
441} // namespace matrix_science
442
443#ifndef SWIG
444#ifdef _INTERNAL_USE_AND_HAVE_BOOST_FORMAT
445#include "private/ms_log_impl.hpp"
446#endif
447#endif
448
449
450#endif // MS_LOG_HPP
451
452/*------------------------------- End of File -------------------------------*/
Definitions for logging messages.
Definition: ms_log.hpp:39
virtual msg_sev getLoggingLevel() const =0
Get the logging level.
int msg_num_t
Typedef for log and error message numbers.
Definition: ms_log.hpp:127
msg_sev
Message severity levels.
Definition: ms_log.hpp:47
Source_e
Logging event source.
Definition: ms_logging.hpp:65