2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 //////////////////////////////////////////////////////////////////////////////////////////////////
20 /// Declares the external APIs to Logger.
22 //////////////////////////////////////////////////////////////////////////////////////////////////
25 * @brief \~english Declares the external APIs to Logger.
27 /** @addtogroup BaseSystem
30 /** @addtogroup native_service
34 /** @addtogroup framework_unified
35 * @ingroup Native_service
38 /** @addtogroup native
39 * @ingroup framework_unified
42 #ifndef __NATIVESERVICES_LOGGER_IF_H__ // NOLINT (build/header_guard)
43 #define __NATIVESERVICES_LOGGER_IF_H__
45 #include <native_service/frameworkunified_types.h>
52 #define FRAMEWORKUNIFIEDLOG_MSGQ_NAME "/NSLog"
53 #define FRAMEWORKUNIFIEDLOG_SHAREDMEM_NAME "/frameworkunified_debug.log.1"
54 #define FRAMEWORKUNIFIEDLOG_SHAREDMEM_SIZE 5242880 // 5MB
56 #define MASTER_ZONE_COUNT 16U
58 #include <native_service/loglibrarylog_if.h>
60 ///////////////////////////////////////////////////////////////////////////////
61 /// \ingroup tag_NSLogger
62 /// \brief typedef of ZONE
63 ///////////////////////////////////////////////////////////////////////////////
64 typedef UI_32 TFrameworkunifiedZone;
65 // Note: if the BITS_IN_TZONE macro is getting modified do the corresponding changes
66 // in GET_ZONE_INDEX and GET_ZONE_BIT_MASK
67 #define BITS_IN_BYTE (8U)
68 #define BITS_IN_TZONE ((UI_32 )(sizeof( TFrameworkunifiedZone ) * BITS_IN_BYTE))
69 #define TZONE_COUNT ((UI_32)MASTER_ZONE_COUNT)
70 #define BITS_IN_ZONE_MASK ((UI_32)(BITS_IN_TZONE * TZONE_COUNT))
71 #define DEBUG_ZONE_COUNT BITS_IN_ZONE_MASK
73 #define ZONE_MASK_ARRAY_ELTS ((UI_32)TZONE_COUNT)
75 #define USER_ZONES_COUNT BITS_IN_ZONE_MASK -10
77 #define ZONE_TEXT_SIZE 24
79 ///////////////////////////////////////////////////////////////////////////////
80 /// \ingroup tag_NSLogger
81 /// \brief Array of mask options
82 ///////////////////////////////////////////////////////////////////////////////
83 typedef TFrameworkunifiedZone TFrameworkunifiedZoneMask[ZONE_MASK_ARRAY_ELTS];
85 typedef enum _TFrameworkunifiedLoggerSeverity {
86 FRAMEWORKUNIFIED_SEVERITY_LOW = 0x0, /// <all enable(default)
87 FRAMEWORKUNIFIED_SEVERITY_DEBUG2, /// <enable FRAMEWORKUNIFIEDLOG_DEBUG() and FRAMEWORKUNIFIEDLOG_DEBUG2() and all the follows
88 FRAMEWORKUNIFIED_SEVERITY_DEBUG1, /// <enable FRAMEWORKUNIFIEDLOG_DEBUG1() and all the follows
89 FRAMEWORKUNIFIED_SEVERITY_INFO, /// <enable FRAMEWORKUNIFIEDLOG_INFO() and all the follows
90 FRAMEWORKUNIFIED_SEVERITY_WARN, /// <enable FRAMEWORKUNIFIEDLOG_WARN() and all the follows
91 FRAMEWORKUNIFIED_SEVERITY_ERROR, /// <enable FRAMEWORKUNIFIEDLOG_ERROR() and all the follows
92 FRAMEWORKUNIFIED_SEVERITY_FATAL, /// <enable FRAMEWORKUNIFIEDLOG_FATAL() and FRAMEWORKUNIFIEDLOG_ALWAYS()
93 FRAMEWORKUNIFIED_SEVERITY_ALWAYS /// <enable FRAMEWORKUNIFIEDLOG_ALWAYS()
94 } TFrameworkunifiedLoggerSeverity;
96 ///////////////////////////////////////////////////////////////////////////////
97 /// \ingroup tag_NSLogger
98 /// \brief FRAMEWORKUNIFIEDLOG parameter
99 ///////////////////////////////////////////////////////////////////////////////
100 typedef struct _FRAMEWORKUNIFIEDLOGPARAM {
101 UI_8 uiLogOptions; /// <output options (ref. NS_LoggingMethod_t )
102 CHAR cZones[USER_ZONES_COUNT][ZONE_TEXT_SIZE]; /// <mask text ZONE_TEXT_10 ... ZONE_TEXT_n
103 TFrameworkunifiedZoneMask uiZoneMask; /// <mask options ZONEMASK(10)...ZONEMASK(n) (ref. TFrameworkunifiedZone)
104 TFrameworkunifiedLoggerSeverity eSeverity; /// <severity level(ref. TFrameworkunifiedLoggerSeverity)
105 } FRAMEWORKUNIFIEDLOGPARAM, *LPFRAMEWORKUNIFIEDLOGPARAM;
107 ///////////////////////////////////////////////////////////////////////////////
108 /// \ingroup tag_NSLogger
109 /// \brief FRAMEWORKUNIFIEDLOG output direction
110 /// \note LMSGQ and LSLOGGER are disabled
111 ///////////////////////////////////////////////////////////////////////////////
112 typedef enum _NS_LOGGER_METHODS {
113 LPRINT = 0x01, /// <Print to the console(similar to printf)
114 LMSGQ = 0x02, /// <Disabled
115 LSLOGGER = 0x04, /// <Disabled
116 LSHAREDMEM = 0x08 /// <Output to shared memory. this is the default logging method.
117 } NS_LoggingMethod_t;
118 // Note: Don't remove #paragma pack(1) this is required for the
119 // ARM processor, forces data structures to be on a byte boundary
120 // all messages should be place in between #pragma pack(1) and #pragma pack()
121 #pragma pack(1) // *** DO NOT REMOVE ***
123 typedef struct tag_Change_Log_Parameters {
124 TFrameworkunifiedZoneMask uiZoneMask;
126 TFrameworkunifiedLoggerSeverity eSeverity;
129 #pragma pack(0) // *** DO NOT REMOVE ***
132 #define NS_RCS_LOGGER_PLUGIN_Q "/NsRcsLoggerPlugin"
134 typedef enum _NS_RCS_LOGGER_SETTINGS {
135 NS_RCS_LOGGER_PLUGIN_ADD_APPNAME = 0x500,
136 } NS_RCS_LOGGER_SETTINGS;
138 typedef struct _TNS_EnableRcsLogging {
139 CHAR m_cAppName[MAX_NAME_SIZE_APP];
141 } TNS_EnableRcsLogging;
145 ////////////////////////////////////////////////////////////////////////////////////////////
147 /// \~english @par Brief
148 /// Writes a log to the Native Services logging mechanism
149 /// \~english @param [in] p_lLine_i
150 /// const UI_16 - Line number(0 to 65535) that this log was was written on
151 /// \~english @param [in] f_uiZoneIndex
152 /// const UI_64 - Mask value(0 to 511) to check against
153 /// \~english @param [in] p_pstrClassName_i
154 /// PCSTR - Name of the class or method where the log was written
155 /// \~english @param [in] lpszFormat
156 /// PCSTR - string similar to that of a printf statement
157 /// \~english @param [in] arg list
158 /// ... - Data arguments(option)
159 /// \~english @retval none
160 /// void - there is no return.
161 /// \~english @par Prerequisite
162 /// FRAMEWORKUNIFIEDLOG parameter is set throuth NsLogSetFrameworkunifiedLogParams
163 /// \~english @par Change of internal state
165 /// \~english @par Conditions of processing failure
166 /// - Real-time log output switch can be turn on by NsLogSetRealtimeLog() generally.
167 /// But in case of FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_FREEZE real-time log and/ramd/BS/ss/logger_service/rwdata/frameworkunifiedlog /will not print out
169 /// - in the following conditions,real-time log will not print out:
170 /// - log output way is LPRINT but f_uiZoneIndex parameter is in [96 to 127]
171 /// - log output way is LPRINT but real-time log output setting is
172 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_OFF
173 /// - log output way is LPRINT,real-time log output setting is
174 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_USB and mq_open system call failed
175 /// - log output way is LPRINT,real-time log output setting is
176 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_USB and mq_send system call failed
177 /// - log output way is LPRINT,real-time log output setting is
178 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and socket system call failed
179 /// - log output way is LPRINT,real-time log output setting is
180 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and setsockopt system call failed
181 /// - log output way is LPRINT,real-time log output setting is
182 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and bind system call failed
183 /// - log output way is LPRINT,real-time log output setting is
184 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and inet_addr system call failed
185 /// - log output way is LPRINT,real-time log output setting is
186 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and sendto system call failed(retry 5 times)
187 /// - log output way is LPRINT,real-time log output setting is
188 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_USB_DISABLE
190 /// in the following conditions /ramd/BS/ss/logger_service/rwdata/frameworkunifiedlog/ log can not be print out
191 /// - log file for parameter f_uiZoneIndex and
192 /// log file for parameter FrameworkunifiedLogFlagId which is set by FRAMEWORKUNIFIEDLOG parameter can not be found
193 /// - the ring_buffer of log file(log file for FrameworkunifiedLogFlagId which is set by FRAMEWORKUNIFIEDLOG parameter when
194 /// log file is not exited) for parameter f_uiZoneIndex is not opened (CNSRingBuffer::IsOpen())
195 /// - the write-in operation to ring_buffer of log file for parameter f_uiZoneIndex
196 /// (log file for FrameworkunifiedLogFlagId which is set by FRAMEWORKUNIFIEDLOG parameter when file is not exited) is failed
197 /// \~english @par Detail
198 /// Writes a log to the Native Services logging mechanism
199 /// \~english @par Classification
201 /// \~english @par Type
205 ////////////////////////////////////////////////////////////////////////////////////////////
206 void NsLog(const UI_16 p_lLine_i, // Line number where message was generated
207 const UI_16 f_uiZoneIndex,
208 PCSTR p_pstrClassName_i,
212 __attribute__((format(printf, 4, 5)))
214 ; // NOLINT (readability/nolint)
216 ////////////////////////////////////////////////////////////////////////////////////////////
218 /// \~english @par Brief
219 /// Writes a log to the Native Services logging mechanism
220 /// \~english @param [in] p_lLine_i
221 /// const UI_16 - Line number(0 to 65535) that this log was was written on
222 /// \~english @param [in] f_uiZoneIndex
223 /// const UI_64 - Mask value(0 to 511) to check against
224 /// \~english @param [in] p_pstrClassName_i
225 /// PCSTR - Name of the class or method where the log was written
226 /// \~english @param [in] lpszFormat
227 /// PCSTR - string similar to that of a printf statement
228 /// \~english @param [in] arg list
229 /// ... - Data arguments(option)
230 /// \~english @retval none
231 /// void - there is no return.
232 /// \~english @par Prerequisite
233 /// FRAMEWORKUNIFIEDLOG parameter is set throuth NsLogSetFrameworkunifiedLogParams
234 /// \~english @par Change of internal state
236 /// \~english @par Conditions of processing failure
237 /// - Real-time log output switch can be turn on by NsLogSetRealtimeLog() generally.
238 /// But in case of FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_FREEZE real-time log and/ramd/BS/ss/logger_service/rwdata/frameworkunifiedlog /will not print out
240 /// - in the following conditions,real-time log will not print out:
241 /// - log output way is LPRINT but f_uiZoneIndex parameter is in [96 to 127]
242 /// - log output way is LPRINT but real-time log output setting is
243 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_OFF
244 /// - log output way is LPRINT,real-time log output setting is
245 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_USB and mq_open system call failed
246 /// - log output way is LPRINT,real-time log output setting is
247 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_USB and mq_send system call failed
248 /// - log output way is LPRINT,real-time log output setting is
249 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and socket system call failed
250 /// - log output way is LPRINT,real-time log output setting is
251 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and setsockopt system call failed
252 /// - log output way is LPRINT,real-time log output setting is
253 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and bind system call failed
254 /// - log output way is LPRINT,real-time log output setting is
255 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and inet_addr system call failed
256 /// - log output way is LPRINT,real-time log output setting is
257 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and sendto system call failed(retry 5 times)
258 /// - log output way is LPRINT,real-time log output setting is
259 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_USB_DISABLE
261 /// in the following conditions /ramd/BS/ss/logger_service/rwdata/frameworkunifiedlog/ log can not be print out
262 /// - log file for parameter f_uiZoneIndex and
263 /// log file for parameter FrameworkunifiedLogFlagId which is set by FRAMEWORKUNIFIEDLOG parameter can not be found
264 /// - the ring_buffer of log file(log file for FrameworkunifiedLogFlagId which is set by FRAMEWORKUNIFIEDLOG parameter when
265 /// log file is not exited) for parameter f_uiZoneIndex is not opened (CNSRingBuffer::IsOpen())
266 /// - the write-in operation to ring_buffer of log file for parameter f_uiZoneIndex
267 /// (log file for FrameworkunifiedLogFlagId which is set by FRAMEWORKUNIFIEDLOG parameter when file is not exited) is failed
268 /// \~english @par Detail
269 /// Writes a log to the Native Services logging mechanism
270 /// \~english @par Classification
272 /// \~english @par Type
276 ////////////////////////////////////////////////////////////////////////////////////////////
277 void NsLog0(const UI_16 p_lLine_i, // Line number where message was generated
278 const UI_16 f_uiZoneIndex,
279 PCSTR p_pstrClassName_i,
282 ////////////////////////////////////////////////////////////////////////////////////////////
283 /// \ingroup NsLogTime
284 /// \~english @par Brief
285 /// Print out real-time in log using Native Service mechanism
286 /// \~english @param [in] f_uiZoneIndex
287 /// const UI_64 - Mask value(0 to 511) to check against
288 /// \~english @param [in] lpszFormat
289 /// PCSTR - string similar to that of a printf statement
290 /// \~english @retval none
291 /// void - there is no return.
292 /// \~english @par Prerequisite
293 /// parameter FRAMEWORKUNIFIEDLOG has already set using NsLogSetFrameworkunifiedLogParams
294 /// \~english @par Change of internal state
296 /// \~english @par Conditions of processing failure
297 /// - Real-time log output switch can be turn on by NsLogSetRealtimeLog() generally.
298 /// But in case of FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_FREEZE real-time log and/ramd/BS/ss/logger_service/rwdata/frameworkunifiedlog /will not print out
300 /// - in the following conditions,real-time log will not print out:
301 /// - log output way is LPRINT but f_uiZoneIndex parameter is in [96 to 127]
302 /// - log output way is LPRINT but real-time log output setting is
303 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_OFF
304 /// - log output way is LPRINT,real-time log output setting is
305 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_USB and mq_open system call failed
306 /// - log output way is LPRINT,real-time log output setting is
307 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_USB and mq_send system call failed
308 /// - log output way is LPRINT,real-time log output setting is
309 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and socket system call failed
310 /// - log output way is LPRINT,real-time log output setting is
311 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and setsockopt system call failed
312 /// - log output way is LPRINT,real-time log output setting is
313 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and bind system call failed
314 /// - log output way is LPRINT,real-time log output setting is
315 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and inet_addr system call failed
316 /// - log output way is LPRINT,real-time log output setting is
317 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER and sendto system call failed(retry 5 times)
318 /// - log output way is LPRINT,real-time log output setting is
319 /// FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_USB_DISABLE
321 /// in the following conditions /ramd/BS/ss/logger_service/rwdata/frameworkunifiedlog/ log can not be print out
322 /// - log file for parameter f_uiZoneIndex and
323 /// log file for parameter FrameworkunifiedLogFlagId which is set by FRAMEWORKUNIFIEDLOG parameter can not be found
324 /// - the ring_buffer of log file(log file for FrameworkunifiedLogFlagId which is set by FRAMEWORKUNIFIEDLOG parameter when
325 /// log file is not exited) for parameter f_uiZoneIndex is not opened (CNSRingBuffer::IsOpen())
326 /// - the write-in operation to ring_buffer of log file for parameter f_uiZoneIndex
327 /// (log file for FrameworkunifiedLogFlagId which is set by FRAMEWORKUNIFIEDLOG parameter when file is not exited) is failed
328 /// \~english @par Detail
329 /// Print out real-time in log using Native Service mechanism
330 /// \~english @par Classification
332 /// \~english @par Type
336 ////////////////////////////////////////////////////////////////////////////////////////////
337 void NsLogTime(const UI_16 f_uiZoneIndex,
340 ////////////////////////////////////////////////////////////////////////////////////////////
341 /// \ingroup NsLogData
342 /// \~english @par Brief
343 /// log print-out function
344 /// \~english @param [in] f_uiZoneIndex
345 /// const UI_64 - Mask value(0 to 511) to check against
346 /// \~english @param [in] data
347 /// PCSTR -log print-out data
348 /// \~english @param [in] size (0 to ULONG_MAX)
349 /// UI_32 - data size (0 to ULONG_MAX)
350 /// \~english @retval none
351 /// void - there is no return.
352 /// \~english @par Prerequisite
353 /// FRAMEWORKUNIFIEDLOG has already set by NsLogSetFrameworkunifiedLogParams
354 /// \~english @par Change of internal state
356 /// \~english @par Conditions of processing failure
357 /// -Process will failed under following conditions:
358 /// -Real-time log output switch can be turn on by NsLogSetRealtimeLog() generally.
359 /// But the set value is FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_FREEZE
360 /// -the log file for f_uiZoneIndex and log file for FrameworkunifiedLogFlagId which is set by FRAMEWORKUNIFIEDLOG parameter
361 /// are both not found
362 /// - the ring_buffer of log file for f_uiZoneIndex(using log file for FrameworkunifiedLogFlagId which is set by FRAMEWORKUNIFIEDLOG
363 /// if file is not exited)is not opened (CNSRingBuffer::IsOpen())
364 /// - write operation on ring_buffer of log file for f_uiZoneIndex
365 /// (using log file for FrameworkunifiedLogFlagId which is set by FRAMEWORKUNIFIEDLOG if file is not exited)is failed
366 /// \~english @par Detail
367 /// the difference bewteen NsLog and NsLogData:
368 /// - NsLog()will print out real-time log
369 /// NsLogData() will not print out real-time log but noly print out logs under /ramd/BS/ss/logger_service/rwdata/frameworkunifiedlog/
370 /// - NsLog() will add ZoneIndex, process name, real-time info to log but
371 /// NsLogData() only print out log
372 /// \~english @par Classification
374 /// \~english @par Type
378 ////////////////////////////////////////////////////////////////////////////////////////////
379 void NsLogData(const UI_16 f_uiZoneIndex,
383 ////////////////////////////////////////////////////////////////////////////////////////////
384 /// \ingroup NsLogSetFrameworkunifiedLogParams
385 /// \~english @par Brief
386 /// Sets the FRAMEWORKUNIFIEDLOG parameter of your application\process based on
387 /// the value passed in.
388 /// \~english @param [in] p_FrameworkunifiedLogParams
389 /// FRAMEWORKUNIFIEDLOGPARAM * - FRAMEWORKUNIFIEDLOG parameter in process
391 /// FRAMEWORKUNIFIEDLOGPARAM Structure
393 /// typedef struct _FRAMEWORKUNIFIEDLOGPARAM {
394 /// UI_8 uiLogOptions; // output options (ref. NS_LoggingMethod_t )
395 /// CHAR cZones[USER_ZONES_COUNT][ZONE_TEXT_SIZE]; // mask text ZONE_TEXT_10 ... ZONE_TEXT_n
396 /// // mask options ZONEMASK(10)...ZONEMASK(n) (ref. TFrameworkunifiedZone)
397 /// TFrameworkunifiedZoneMask uiZoneMask;
398 /// TFrameworkunifiedLoggerSeverity eSeverity; // severity level(ref. TFrameworkunifiedLoggerSeverity)
399 /// } FRAMEWORKUNIFIEDLOGPARAM, *LPFRAMEWORKUNIFIEDLOGPARAM;
402 /// TFrameworkunifiedZoneMask Array
404 /// typedef TFrameworkunifiedZone TFrameworkunifiedZoneMask[ZONE_MASK_ARRAY_ELTS];
407 /// TFrameworkunifiedZone typedef
409 /// UI_32 TFrameworkunifiedZone; // 32bit
412 /// TFrameworkunifiedLoggerSeverity Enum
414 /// typedef enum _TFrameworkunifiedLoggerSeverity {
415 /// FRAMEWORKUNIFIED_SEVERITY_LOW = 0x0, // all enable(default)
416 /// FRAMEWORKUNIFIED_SEVERITY_DEBUG2, // enable FRAMEWORKUNIFIEDLOG_DEBUG() and FRAMEWORKUNIFIEDLOG_DEBUG2() and all the follows
417 /// FRAMEWORKUNIFIED_SEVERITY_DEBUG1, // enable FRAMEWORKUNIFIEDLOG_DEBUG1() and all the follows
418 /// FRAMEWORKUNIFIED_SEVERITY_INFO, // enable FRAMEWORKUNIFIEDLOG_INFO() and all the follows
419 /// FRAMEWORKUNIFIED_SEVERITY_WARN, // enable FRAMEWORKUNIFIEDLOG_WARN() and all the follows
420 /// FRAMEWORKUNIFIED_SEVERITY_ERROR, // enable FRAMEWORKUNIFIEDLOG_ERROR() and all the follows
421 /// FRAMEWORKUNIFIED_SEVERITY_FATAL, // enable FRAMEWORKUNIFIEDLOG_FATAL() and FRAMEWORKUNIFIEDLOG_ALWAYS()
422 /// FRAMEWORKUNIFIED_SEVERITY_ALWAYS // enable FRAMEWORKUNIFIEDLOG_ALWAYS()
423 /// } TFrameworkunifiedLoggerSeverity;
425 /// \~english @retval none
426 /// void - there is no return.
427 /// \~english @par Prerequisite
429 /// \~english @par Change of internal state
431 /// \~english @par Conditions of processing failure
432 /// - process will not conducted when p_FrameworkunifiedLogParams is NULL.
433 /// \~english @par Detail
434 /// set the FRAMEWORKUNIFIEDLOG of Application using the parameter set in parameter\n
435 /// ZONE_NS_WAR(8), ZONE_NS_ERR(9) will be put-out forcely in the function\n
436 /// log will be print out when ForceOutput is set.
437 /// \~english @par Classification
439 /// \~english @par Type
443 ////////////////////////////////////////////////////////////////////////////////////////////
444 void NsLogSetFrameworkunifiedLogParams(FRAMEWORKUNIFIEDLOGPARAM *p_FrameworkunifiedLogParams);
446 ////////////////////////////////////////////////////////////////////////////////////////////
447 /// \ingroup NsLogSetProcessName
448 /// \~english @par Brief
449 /// Sets the name of your application\process based on
450 /// the value passed in.
451 /// \~english @param [in] p_strProcessName_i
452 /// PCSTR - name of your application process.(string array ended by NULL below 20byte)
453 /// \~english @retval none
454 /// void - there is no return.
455 /// \~english @par Prerequisite
457 /// \~english @par Change of internal state
459 /// \~english @par Conditions of processing failure
460 /// The specified Aplication names are not set in the following cases:
461 /// - When the Application name specified in the arguments (p_strProcessName_i) is NULL
462 /// - When the Application name specified in the arguments (p_strProcessName_i) is a NULL termination character string of 21 bytes or more
463 /// \~english @par Detail
464 /// -name in prarameter should be string array(less than 20byte) ended by NULL
465 /// \~english @par Classification
467 /// \~english @par Type
471 ////////////////////////////////////////////////////////////////////////////////////////////
472 void NsLogSetProcessName(PCSTR p_strProcessName_i);
474 ////////////////////////////////////////////////////////////////////////////////////////////
475 /// \ingroup NsLogSetControlMask
476 /// \~english @par Brief
477 /// Sets the control word that should be logged
478 /// \~english @param [in] p_ulNSLogControl_i
479 /// TFrameworkunifiedZoneMask - Set mask to the new value.
481 /// TFrameworkunifiedZoneMask Array
483 /// typedef TFrameworkunifiedZone TFrameworkunifiedZoneMask[ZONE_MASK_ARRAY_ELTS];
486 /// TFrameworkunifiedZone typedef
488 /// UI_32 TFrameworkunifiedZone; // 32bit
490 /// \~english @retval none
491 /// void - there is no return.
492 /// \~english @par Prerequisite
494 /// \~english @par Change of internal state
496 /// \~english @par Conditions of processing failure
497 /// -process will not be conducted when p_ulNSLogControl_i is none
498 /// \~english @par Detail
499 /// -Sets the control word that should be logged
500 /// zone mask(16) will be rewrited using parameter value
501 /// \~english @par Classification
503 /// \~english @par Type
506 /// NsLogGetControlMask
507 ////////////////////////////////////////////////////////////////////////////////////////////
508 void NsLogSetControlMask(TFrameworkunifiedZoneMask p_ulNSLogControl_i);
510 ////////////////////////////////////////////////////////////////////////////////////////////
511 /// \ingroup NsLogIsZoneSet
512 /// \~english @par Brief
513 /// check wheather the FRAMEWORKUNIFIEDLOG ZONE is set by your application process.
514 /// \~english @param [in] set_zone
515 /// UI_32 - checking zone_index
516 /// \~english @retval TRUE zone is enable
517 /// \~english @retval FALSE zone is disable
518 /// \~english @par Prerequisite
520 /// \~english @par Change of internal state
522 /// \~english @par Conditions of processing failure
523 /// If the parameter of set_zone is outside(set_zone < 0 or 511 > set_zone), it will return FALSE.
524 /// \~english @par Detail
525 /// check wheather the FRAMEWORKUNIFIEDLOG ZONE is set by your application process.\n
526 /// zone parameter first 4bit(0 to 15)is the index of zone mask array\n
527 /// second 5bit(0 to 31) is showing bit position of mask(9bit,511 for the most)\n
528 /// True will be returned when bit for zone mask is set as 1
529 /// \~english @par Classification
531 /// \~english @par Type
535 ////////////////////////////////////////////////////////////////////////////////////////////
536 BOOL NsLogIsZoneSet(UI_32 set_zone);
538 ////////////////////////////////////////////////////////////////////////////////////////////
539 /// \ingroup NsLogGetControlMask
540 /// \~english @par Brief
541 /// Get the control word that you currently have set.
542 /// \~english @param [out] p_Zonemask_i
543 /// TFrameworkunifiedZoneMask - current mask value.
545 /// TFrameworkunifiedZoneMask Array
547 /// typedef TFrameworkunifiedZone TFrameworkunifiedZoneMask[ZONE_MASK_ARRAY_ELTS];
550 /// TFrameworkunifiedZone typedef
552 /// UI_32 TFrameworkunifiedZone; // 32bit
554 /// \~english @retval none
555 /// void - there is no return.
556 /// \~english @par Prerequisite
558 /// \~english @par Change of internal state
560 /// \~english @par Conditions of processing failure
561 /// - If p_Zonemask_i is NULL, no operation is performed.
562 /// \~english @par Detail
563 /// Get all 16 zone mask.
564 /// \~english @par Classification
566 /// \~english @par Type
569 /// NsLogSetControlMask
570 ////////////////////////////////////////////////////////////////////////////////////////////
571 void NsLogGetControlMask(TFrameworkunifiedZoneMask p_Zonemask_i);
573 ////////////////////////////////////////////////////////////////////////////////////////////
574 /// \ingroup NsLogSetLogMethod
575 /// \~english @par Brief
576 /// Sets the logging place, LPRINT, LSHAREDMEM or any combination of these.
577 /// If this is never called the default is LSHAREDMEM.
578 /// \~english @param [in] p_eMethod_i
579 /// UI_8 - Where you would like to log your data.
581 /// NS_LoggingMethod_t Enum
583 /// typedef enum _NS_LOGGER_METHODS {
584 /// LPRINT = 0x01, // Print to the console(similar to printf)
585 /// LMSGQ = 0x02, // Disabled
586 /// LSLOGGER = 0x04, // Disabled
587 /// LSHAREDMEM = 0x08 // Output to shared memory. this is the default logging method.
588 /// } NS_LoggingMethod_t;
590 /// \~english @retval none
591 /// void - there is no return.
592 /// \~english @par Prerequisite
594 /// \~english @par Change of internal state
595 /// -switch the out-put place for NsLog API
596 /// \~english @par Conditions of processing failure
598 /// \~english @par Detail
599 /// Sets the logging place, LPRINT, LSHAREDMEM or any combination of these.
600 /// If this is never called the default is LSHAREDMEM.
601 /// \~english @par Classification
603 /// \~english @par Type
606 /// NsLogGetLogMethod
607 ////////////////////////////////////////////////////////////////////////////////////////////
608 void NsLogSetLogMethod(UI_8 p_eMethod_i);
610 ////////////////////////////////////////////////////////////////////////////////////////////
611 /// \ingroup NsLogGetLogMethod
612 /// \~english @par Brief
613 /// Get the logging method.
614 /// \~english @param None
615 /// \~english @retval - return the way you log your data.
616 /// UI_8 - Log data type(NS_LoggingMethod_t Enum).
618 /// NS_LoggingMethod_t Enum
620 /// typedef enum _NS_LOGGER_METHODS {
621 /// LPRINT = 0x01, // Print to the console(similar to printf)
622 /// LMSGQ = 0x02, // Disabled
623 /// LSLOGGER = 0x04, // Disabled
624 /// LSHAREDMEM = 0x08 // Output to shared memory. this is the default logging method.
625 /// } NS_LoggingMethod_t;
627 /// \~english @par Prerequisite
629 /// \~english @par Change of internal state
630 /// - The internal state is not changed.
631 /// \~english @par Conditions of processing failure
633 /// \~english @par Detail
634 /// Invoke callback function to get the logging method.\n
635 /// If callback function is null and expectedCalls is '0',
636 /// using default SetSeparator function to get the logging method. \n
637 /// \~english @par Classification
639 /// \~english @par Type
642 /// NsLogSetLogMethod
643 ////////////////////////////////////////////////////////////////////////////////////////////
644 UI_8 NsLogGetLogMethod(void);
646 ////////////////////////////////////////////////////////////////////////////////////////////
647 /// \ingroup NsLogInitialize
648 /// \~english @par Brief
649 /// Initialize the log level and real-time log out-put setting
650 /// \~english @retval none
651 /// void - there is no return.
652 /// \~english @par Prerequisite
654 /// \~english @par Change of internal state
656 /// \~english @par Conditions of processing failure
657 /// if the getting process of FRAMEWORKUNIFIEDLOG CONFIG file data is failed
658 /// \~english @par Detail
659 /// Initialize the log level and real-time log out-put setting
660 /// if the getting process of FRAMEWORKUNIFIEDLOG CONFIG file data is failed,log
661 /// level and real-time log out-put setting will not be initialized
662 /// \~english @par Classification
664 /// \~english @par Type
668 ////////////////////////////////////////////////////////////////////////////////////////////
669 void NsLogInitialize(void);
671 ////////////////////////////////////////////////////////////////////////////////////////////
672 /// \ingroup NsLogSetFrameworkunifiedLogFlag
673 /// \~english @par Brief
674 /// set LogLevel of FRAMEWORKUNIFIEDLOG flag
675 /// \~english @param [in] flag_id
676 /// UI_8 - index for FRAMEWORKUNIFIEDLOG flag(0 to FLAG_LIST(declared in FRAMEWORKUNIFIEDLOG CONFIG file)
677 /// \~english @param [in] mode
680 /// avaliable LogLevel
681 /// - FRAMEWORKUNIFIEDLOG_FLAG_MODE_RELEASE
682 /// - FRAMEWORKUNIFIEDLOG_FLAG_MODE_DEBUG
683 /// \~english @retval none
684 /// void - there is no return.
685 /// \~english @par Prerequisite
687 /// \~english @par Change of internal state
689 /// \~english @par Conditions of processing failure
690 /// in the following conditions FRAMEWORKUNIFIEDLOG flag will not be set
691 /// - mode is not FRAMEWORKUNIFIEDLOG_FLAG_MODE_RELEASE, FRAMEWORKUNIFIEDLOG_FLAG_MODE_DEBUG
692 /// - the getting process of FRAMEWORKUNIFIEDLOG CONFIG file is failed(ns_logger_frameworkunifiedlog_xxx.cfg)
693 /// - flag_id is not declared in FRAMEWORKUNIFIEDLOG CONFIG file
694 /// \~english @par Detail
695 /// set loglevel for specific FRAMEWORKUNIFIEDLOG flag
696 /// \~english @par Classification
698 /// \~english @par Type
701 /// NsLogGetFrameworkunifiedLogFlag
702 ////////////////////////////////////////////////////////////////////////////////////////////
703 void NsLogSetFrameworkunifiedLogFlag(UI_8 flag_id, UI_8 mode);
705 ////////////////////////////////////////////////////////////////////////////////////////////
706 /// \ingroup NsLogGetFrameworkunifiedLogFlag
707 /// \~english @par Brief
708 /// get LogLevel of FRAMEWORKUNIFIEDLOG flag
709 /// \~english @param [in] flag_id
710 /// UI_8 - index for FRAMEWORKUNIFIEDLOG flag(0 to FLAG_LIST(declared in FRAMEWORKUNIFIEDLOG CONFIG file)
711 /// \~english @param [out]mode
712 /// UI_8 - LogLevel value
714 /// void - there is no return.
715 /// \~english @retval eFrameworkunifiedStatusOK Success
716 /// \~english @retval eFrameworkunifiedStatusFail any sort of error occurred
717 /// \~english @par Prerequisite
719 /// \~english @par Change of internal state
721 /// \~english @par Conditions of processing failure
722 /// -parameter mode is NULL[eFrameworkunifiedStatusFail]
723 /// -flag_id is not declared in FRAMEWORKUNIFIEDLOG CONFIG file [eFrameworkunifiedStatusFail]
724 /// \~english @par Detail
725 /// get FRAMEWORKUNIFIEDLOG flage for specific flag_id
726 /// \~english @par Classification
728 /// \~english @par Type
731 /// NsLogSetFrameworkunifiedLogFlag
732 ////////////////////////////////////////////////////////////////////////////////////////////
733 EFrameworkunifiedStatus NsLogGetFrameworkunifiedLogFlag(UI_8 flag_id, UI_8 *mode);
735 ////////////////////////////////////////////////////////////////////////////////////////////
736 /// \ingroup NsLogSetRealtimeLog
737 /// \~english @par Brief
738 /// real-time log output setting
739 /// \~english @param [in] mode
740 /// UI_8 - set mode for Real time log
742 /// available setting for real-time log output
743 /// default value is REALTIME_LOG in FRAMEWORKUNIFIEDLOG CFG file
744 /// (FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_OFF when FRAMEWORKUNIFIEDLOG CFG file get failed)
746 /// #define FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_UART 1 // : UARTOUT
747 /// #define FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_USB 2 // : USB OUT
748 /// #define FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_USB_DISABLE 0x82 // : USB OFF
749 /// #define FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER 3 // : Ether OUT
750 /// #define FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_OFF 0 // : ALL OFF
751 /// #define FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_FREEZE 0xFF // : FREEZE
753 /// \~english @retval none
754 /// void - there is no return
755 /// \~english @par Prerequisite
757 /// \~english @par Change of internal state
759 /// \~english @par Conditions of processing failure
760 /// -mode is not in FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_XXX above
761 /// \~english @par Detail
762 /// set the real-time log output using the setting value.\n
763 /// need to reboot during ROM start in order to switch to Ethernet output\n
764 /// /nv/BS/ns/framework_unified/rwdata/frameworkunifiedlog.ether file will be generated
765 /// when mode FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER /nv/BS/ns/framework_unified/rwdata/frameworkunifiedlog.ether\n
766 /// and /nv/BS/ns/framework_unified/rwdata/frameworkunifiedlog.ether file will be delated when mode is not FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER
767 /// \~english @par Classification
769 /// \~english @par Type
772 /// NsLogGetRealtimeLog
773 ////////////////////////////////////////////////////////////////////////////////////////////
774 void NsLogSetRealtimeLog(UI_8 mode);
776 ////////////////////////////////////////////////////////////////////////////////////////////
777 /// \ingroup NsLogGetRealtimeLog
778 /// \~english @par Brief
779 /// get the setting of real-time log output
780 /// \~english @param [out] mode
781 /// UI_8 * -the setting of real-time log output
783 /// available settings of real-time log output
784 /// default value is REALTIME_LOG in FRAMEWORKUNIFIEDLOG CFG file
785 /// (FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_OFF when FRAMEWORKUNIFIEDLOG CFG file get failed)
787 /// #define FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_UART 1 // : UARTOUT
788 /// #define FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_USB 2 // : USB OUT
789 /// #define FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_USB_DISABLE 0x82 // : USB OFF
790 /// #define FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_ETHER 3 // : Ether OUT
791 /// #define FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_OFF 0 // : ALL OFF
792 /// #define FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_FREEZE 0xFF // : FREEZE
794 /// \~english @retval none
795 /// void - there is no return
796 /// \~english @par Prerequisite
798 /// \~english @par Change of internal state
800 /// \~english @par Conditions of processing failure
801 /// - cannot get when mode is NULL
802 /// -FRAMEWORKUNIFIEDLOG_REALTIMELOG_MODE_OFF will be returned when the approach
803 /// of FRAMEWORKUNIFIEDLOG CONFIG file (ns_logger_frameworkunifiedlog_xxx.cfg)is failed
804 /// \~english @par Detail
805 /// get the setting of real-time log output
806 /// \~english @par Classification
808 /// \~english @par Type
811 /// NsLogSetRealtimeLog
812 ////////////////////////////////////////////////////////////////////////////////////////////
813 void NsLogGetRealtimeLog(UI_8 *mode);
815 // Deprecated API: Not use.
816 ////////////////////////////////////////////////////////////////////////////////////////////
817 /// \ingroup NsLogSetSeverity
818 /// \~english @par Brief
819 /// Set log severity level
820 /// \~english @param [in] p_eLogSeverity_i
821 /// TFrameworkunifiedLoggerSeverity - Log severity
823 /// TFrameworkunifiedLoggerSeverity Enum
825 /// typedef enum _TFrameworkunifiedLoggerSeverity {
826 /// FRAMEWORKUNIFIED_SEVERITY_LOW = 0x0, /// <all enable(default)
827 /// FRAMEWORKUNIFIED_SEVERITY_DEBUG2, /// <enable FRAMEWORKUNIFIEDLOG_DEBUG() and FRAMEWORKUNIFIEDLOG_DEBUG2() and all the follows
828 /// FRAMEWORKUNIFIED_SEVERITY_DEBUG1, /// <enable FRAMEWORKUNIFIEDLOG_DEBUG1() and all the follows
829 /// FRAMEWORKUNIFIED_SEVERITY_INFO, /// <enable FRAMEWORKUNIFIEDLOG_INFO() and all the follows
830 /// FRAMEWORKUNIFIED_SEVERITY_WARN, /// <enable FRAMEWORKUNIFIEDLOG_WARN() and all the follows
831 /// FRAMEWORKUNIFIED_SEVERITY_ERROR, /// <enable FRAMEWORKUNIFIEDLOG_ERROR() and all the follows
832 /// FRAMEWORKUNIFIED_SEVERITY_FATAL, /// <enable FRAMEWORKUNIFIEDLOG_FATAL() and FRAMEWORKUNIFIEDLOG_ALWAYS()
833 /// FRAMEWORKUNIFIED_SEVERITY_ALWAYS /// <enable FRAMEWORKUNIFIEDLOG_ALWAYS()
834 /// } TFrameworkunifiedLoggerSeverity;
836 /// \~english @retval none
837 /// void - there is no return.
838 /// \~english @par Prerequisite
840 /// \~english @par Change of internal state
841 /// - The internal state is not changed.
842 /// \~english @par Conditions of processing failure
843 /// - Function pointer specified by the argument is NULL.
844 /// - It is an incorrect value(p_eLogSeverity_i).
845 /// \~english @par Detail
846 /// Invoke callback function to set log severity.\n
847 /// If callback function is null and expectedCalls is '0', using default function to set log severity.
848 /// \~english @par Classification
850 /// \~english @par Type
854 ////////////////////////////////////////////////////////////////////////////////////////////
855 void NsLogSetSeverity(TFrameworkunifiedLoggerSeverity p_eLogSeverity_i);
857 // Deprecated API: Not use.
858 ////////////////////////////////////////////////////////////////////////////////////////////
859 /// \ingroup NsLogGetSeverity
860 /// \~english @par Brief
861 /// Get the log severity.
862 /// \~english @param none
863 /// \~english @retval Log Severity
864 /// TFrameworkunifiedLoggerSeverity - Log severity.
866 /// TFrameworkunifiedLoggerSeverity Enum
868 /// typedef enum _TFrameworkunifiedLoggerSeverity {
869 /// FRAMEWORKUNIFIED_SEVERITY_LOW = 0x0, /// <all enable(default)
870 /// FRAMEWORKUNIFIED_SEVERITY_DEBUG2, /// <enable FRAMEWORKUNIFIEDLOG_DEBUG() and FRAMEWORKUNIFIEDLOG_DEBUG2() and all the follows
871 /// FRAMEWORKUNIFIED_SEVERITY_DEBUG1, /// <enable FRAMEWORKUNIFIEDLOG_DEBUG1() and all the follows
872 /// FRAMEWORKUNIFIED_SEVERITY_INFO, /// <enable FRAMEWORKUNIFIEDLOG_INFO() and all the follows
873 /// FRAMEWORKUNIFIED_SEVERITY_WARN, /// <enable FRAMEWORKUNIFIEDLOG_WARN() and all the follows
874 /// FRAMEWORKUNIFIED_SEVERITY_ERROR, /// <enable FRAMEWORKUNIFIEDLOG_ERROR() and all the follows
875 /// FRAMEWORKUNIFIED_SEVERITY_FATAL, /// <enable FRAMEWORKUNIFIEDLOG_FATAL() and FRAMEWORKUNIFIEDLOG_ALWAYS()
876 /// FRAMEWORKUNIFIED_SEVERITY_ALWAYS /// <enable FRAMEWORKUNIFIEDLOG_ALWAYS()
877 /// } TFrameworkunifiedLoggerSeverity;
879 /// \~english @par Prerequisite
881 /// \~english @par Change of internal state
882 /// - The internal state is not changed.
883 /// \~english @par Conditions of processing failure
885 /// \~english @par Detail
886 /// Invoke callback function to get log severity.\n
887 /// If callback function is null and expectedCalls is '0', using default function to get log severity.
888 /// \~english @par Classification
890 /// \~english @par Type
894 ////////////////////////////////////////////////////////////////////////////////////////////
895 TFrameworkunifiedLoggerSeverity NsLogGetSeverity(void);
897 ////////////////////////////////////////////////////////////////////////////////////////////
898 /// \ingroup NsLog_EvtCnt
899 /// \~english @par Brief
900 /// Event and count logger.
901 /// \~english @param [in] @param [in] Cnt_Id
902 /// UI_16 - ID of counter from comm layer
903 /// \~english @param [in] Evt_Id
904 /// UI_16 - ID of Event from comm layer
905 /// \~english @param [in] n
906 /// UI_8 - number of variable arguments inputted
907 /// \~english @param [in] arg list
908 /// ... - Data arguments(option)
909 /// \~english @retval none
910 /// void - there is no return.
911 /// \~english @par Prerequisite
913 /// \~english @par Change of internal state
914 /// - The internal state is not changed.
915 /// \~english @par Conditions of processing failure
916 /// - Function pointer specified by the argument is NULL.
917 /// - It is an incorrect value(Cnt_Id).
918 /// - It is an incorrect value(Evt_Id).
919 /// - It is an incorrect value(n).
920 /// \~english @par Detail
921 /// Invoke callback function with argument 'Cnt_Id', 'Evt_Id', 'n' to log.\n
922 /// If callback function is null and expectedCalls is '0', using default SetSeparator function to log. \n
923 /// In other situation, match and log 'Cnt_Id', 'Evt_Id', 'n'.
924 /// \~english @par Classification
926 /// \~english @par Type
930 ////////////////////////////////////////////////////////////////////////////////////////////
931 // Deprecated API: Not use.
932 void NsLog_EvtCnt( // Line number where message was generated
934 UI_16 Evt_Id, UI_8 n,
937 ////////////////////////////////////////////////////////////////////////////////////////////
938 /// \ingroup NsLog_Evt
939 /// \~english @par Brief
940 /// Event logger mechanism.(Send data to SS event logger Queue)
941 /// \~english @param [in] Evt_Id
942 /// UI_16 - ID of Event from comm layer
943 /// \~english @param [in] nu
944 /// UI_8 - number of variable arguments inputted
945 /// \~english @param [in] ...
946 /// ... - Data arguments
947 /// \~english @retval none
948 /// void - there is no return.
949 /// \~english @par Prerequisite
951 /// \~english @par Change of internal state
953 /// \~english @par Conditions of processing failure
954 /// - process nothing when Evt_id is in [0 to 0xFF]
955 /// - process nothing when nu is not 1 or 4
956 /// \~english @par Detail
957 /// -send the log event queue to SS(logger mechanism Event)
958 /// \~english @par Classification
960 /// \~english @par Type
964 ////////////////////////////////////////////////////////////////////////////////////////////
965 // Deprecated API: Not use.
966 void NsLog_Evt(UI_16 Evt_Id, UI_8 nu, ...);
968 ////////////////////////////////////////////////////////////////////////////////////////////
969 /// \ingroup NsLog_Cnt
970 /// \~english @par Brief
971 /// Counter logger mechanism.(Send data to SS event logger Queue)
972 /// \~english @param [in] Cnt_Id
973 /// UI_16 - ID of Counter from comm layer
974 /// \~english @param [in] nu
975 /// UI_8 - number of variable arguments inputted
976 /// \~english @param [in] ...
977 /// ... - Data arguments
978 /// \~english @retval none
979 /// void - there is no return.
980 /// \~english @par Prerequisite
982 /// \~english @par Change of internal state
984 /// \~english @par Conditions of processing failure
985 /// - process nothing when Cnt_Id is 0
986 /// - process nothing when nu is not 0 or 1
987 /// \~english @par Detail
988 /// send the log event queue to SS(logger mechanism counter)
989 /// \~english @par Classification
991 /// \~english @par Type
995 ////////////////////////////////////////////////////////////////////////////////////////////
996 // Deprecated API: Not use.
997 void NsLog_Cnt(UI_16 Cnt_Id, UI_8 nu, ...); // Not to use.
999 ////////////////////////////////////////////////////////////////////////////////////////////
1000 /// \ingroup NsLogDetermineLogMethod
1001 /// \~english @par Brief
1002 /// Determines the control log method based on the string passed.
1003 /// If the string passed doesn't match any of the key words:
1004 /// slogger or msgr or console the method will return a value of
1005 /// zero. This string may be in the form of the following:
1006 /// "msgq|console" would cause the output to go to both the NSLog
1007 /// message queue and the console.
1008 /// \~english @param [in] output_type
1009 /// PCSTR - The key words:
1010 /// \~english @retval 1 ... 0xF Success
1011 /// \~english @retval 0 the string passed doesn't match any of the key words
1012 /// \~english @par Prerequisite
1014 /// \~english @par Change of internal state
1016 /// \~english @par Conditions of processing failure
1017 /// the string passed doesn't match any of the key words
1018 /// \~english @par Detail
1019 /// mask value retruned from application can be used as parameter in NsLogSetLogMethod()
1020 /// \~english @par Classification
1022 /// \~english @par Type
1026 ////////////////////////////////////////////////////////////////////////////////////////////
1027 UI_8 NsLogDetermineLogMethod(PCSTR output_type);
1030 // VOID NsLogEnableRcsLogging(BOOL f_bRCSEnableLogging);
1033 ////////////////////////////////////////////////////////////////////////////////////////////
1034 /// \ingroup NsLogGetZoneTextList
1035 /// \~english @par Brief
1036 /// Get the zone data list.
1037 /// \~english @param [out] f_cZoneList
1038 /// CHAR [][ZONE_TEXT_SIZE] - zone text list(0 ... 511)
1040 /// PUI_32 - Pointer to preallocated array of CHAR cZones[USER_ZONES_COUNT][ZONE_TEXT_SIZE];
1041 /// \~english @retval none
1042 /// VOID - There is no return
1043 /// \~english @par Prerequisite
1045 /// \~english @par Change of internal state
1046 /// - The internal state is not changed.
1047 /// \~english @par Conditions of processing failure
1048 /// - Function pointer specified by the argument is NULL.
1049 /// - It is an incorrect value(f_cZoneList) or f_cZoneList is empty.
1050 /// - Some error occur when get value from f_cZoneList
1051 /// \~english @par Detail
1052 /// Invoke callback function to get zone text list.\n
1053 /// If callback function is null and expectedCalls is '0', using default function to get zone text list.
1054 /// \~english @par Classification
1056 /// \~english @par Type
1060 ////////////////////////////////////////////////////////////////////////////////////////////
1061 VOID NsLogGetZoneTextList(CHAR f_cZoneList[][ZONE_TEXT_SIZE]);
1063 /////////////////////////////////////////////////////////////////////////////////////
1064 /// \ingroup NsLogSetZones
1065 /// \~english @par Brief
1066 /// set FRAMEWORKUNIFIEDLOG ZONE
1067 /// \~english @param [in] f_uiZoneCount
1068 /// UI_32 - number of zone
1069 /// \~english @param [in] ...
1070 /// arg_list - zone list (0 ... 511)
1071 /// \~english @retval none
1072 /// void - there is no return.
1073 /// \~english @par Prerequisite
1075 /// \~english @par Change of internal state
1077 /// \~english @par Conditions of processing failure
1078 /// - zone value will not over 512
1079 /// \~english @par Detail
1080 /// set the specific bit to existed zone mask\n
1081 /// first 4bit(0 to 15) in zone is the index of zone mask array\n
1082 /// second 5bit(0 to 31)set the 9bit which shows the bit position of mask(blew 511)\n
1083 /// eg:in the case of setting three zones=31,30,29, function should be called like NsLogSetZones(3,31,30,29) \n
1084 /// operation may not be right when parameter shows in arg_list differs with array num in f_uiZoneCount
1086 /// \~english @par Classification
1088 /// \~english @par Type
1092 /////////////////////////////////////////////////////////////////////////////////////
1093 void NsLogSetZones(UI_32 f_uiZoneCount, ...);
1095 /////////////////////////////////////////////////////////////////////////////////////
1096 /// \ingroup NsLogParseZones
1097 /// \~english @par Brief
1098 /// Parse the FRAMEWORKUNIFIEDLOG ZONE.
1099 /// \~english @param [out] p_FrameworkunifiedLogParams
1100 /// FRAMEWORKUNIFIEDLOGPARAM * - Input/output FRAMEWORKUNIFIEDLOG parameter
1101 /// \~english @param [in] f_uiZoneCount
1102 /// UI_32 - Zone setting
1103 /// \~english @param [in] ...
1104 /// arg_list - Zone lists (zone values are 0 to 511)
1106 /// FRAMEWORKUNIFIEDLOGPARAM structures
1108 /// typedef struct _FRAMEWORKUNIFIEDLOGPARAM {
1109 /// UI_8 uiLogOptions; // Log output location (ref NS_LoggingMethod_t)
1110 /// CHAR cZones[USER_ZONES_COUNT][ZONE_TEXT_SIZE]; // ZONE_TEXT_10 ... ZONE_TEXT_n
1111 /// TFrameworkunifiedZoneMask uiZoneMask; // ZONEMASK(10)...ZONEMASK(n) (ref TFrameworkunifiedZone)
1112 /// TFrameworkunifiedLoggerSeverity eSeverity; // Logging level (ref TFrameworkunifiedLoggerSeverity)
1113 /// } FRAMEWORKUNIFIEDLOGPARAM, *LPFRAMEWORKUNIFIEDLOGPARAM;
1115 /// \~english @retval none
1116 /// \~english @par Prerequisite
1118 /// \~english @par Change of internal state
1119 /// - The internal state is not changed.
1120 /// \~english @par Conditions of processing failure
1122 /// \~english @par Detail
1123 /// In the FRAMEWORKUNIFIEDLOG parameter (p_FrameworkunifiedLogParams) specified in the arguments,\n
1124 /// add (or) all masked values of the zone lists specified by the arguments.
1125 /// \~english @par Classification
1129 /////////////////////////////////////////////////////////////////////////////////////
1130 void NsLogParseZones(FRAMEWORKUNIFIEDLOGPARAM *p_FrameworkunifiedLogParams, UI_32 f_uiZoneCount, ...);
1133 // VOID NsRcsSendTraceData(PCHAR f_pData, UI_32 f_len);
1135 ////////////////////////////////////////////////////////////////////////////////////////////
1136 /// \ingroup NSLogGetFrameworkunifiedlogFileTotalNum
1137 /// \~english @par Brief
1138 /// get total number of log file
1139 /// \~english @retval num
1140 /// UI_32 - Total numger of frameworkunifiedlog files.
1141 /// \~english @par Prerequisite
1142 /// set log file using NsLogSetFrameworkunifiedLogParams
1143 /// \~english @par Change of internal state
1145 /// \~english @par Conditions of processing failure
1147 /// \~english @par Detail
1148 /// get total number of log file
1149 /// \~english @par Classification
1151 /// \~english @par Type
1155 ////////////////////////////////////////////////////////////////////////////////////////////
1156 UI_32 NSLogGetFrameworkunifiedlogFileTotalNum(void);
1158 ////////////////////////////////////////////////////////////////////////////////////////////
1159 /// \ingroup NSLogGetFrameworkunifiedlogFileName
1160 /// \~english @par Brief
1161 /// get the name of log file
1162 /// \~english @param [in] index
1163 /// UI_32 - Index of a list of frameworkunifiedlog file names.(0 to NSLogGetFrameworkunifiedlogFileTotalNum()-1)
1164 /// \~english @retval file name -file with specific index is exsisted
1165 /// \~english @retval NULL -file with specific index is not exsisted
1166 /// \~english @par Prerequisite
1167 /// set log file using NsLogSetFrameworkunifiedLogParams
1168 /// \~english @par Change of internal state
1170 /// \~english @par Conditions of processing failure
1171 /// file with specific index is not exsisted
1172 /// \~english @par Detail
1173 /// get the file name with specific index is not exsisted
1174 /// \~english @par Classification
1176 /// \~english @par Type
1180 ////////////////////////////////////////////////////////////////////////////////////////////
1181 PCSTR NSLogGetFrameworkunifiedlogFileName(UI_32 index);
1183 ////////////////////////////////////////////////////////////////////////////////////////////
1184 /// \ingroup NSLogGetFrameworkunifiedlogFileName
1185 /// \~english @par Brief
1186 /// get index of log file
1187 /// \~english @param [in] filename
1188 /// PCSTR - Name of frameworkunifiedlog file.
1189 /// \~english @retval 0 log file specific logfile is not exsisted
1190 /// \~english @retval index of log file specific logfile is exsisted
1191 /// \~english @par Prerequisite
1192 /// set log file using NsLogSetFrameworkunifiedLogParams
1193 /// \~english @par Change of internal state
1195 /// \~english @par Conditions of processing failure
1196 /// process nothing when file name is NULL
1197 /// process nothing when file name is not exsisted
1198 /// \~english @par Detail
1199 /// get index of log file
1200 /// \~english @par Classification
1202 /// \~english @par Type
1206 ////////////////////////////////////////////////////////////////////////////////////////////
1207 int NSLogGetFrameworkunifiedlogIndex(PCSTR filename);
1209 ////////////////////////////////////////////////////////////////////////////////////////////
1210 /// \ingroup NsForceClose
1211 /// \~english @par Brief
1212 /// clear log forcely.
1213 /// \~english @retval none
1215 /// \~english @par Prerequisite
1217 /// \~english @par Change of internal state
1219 /// \~english @par Conditions of processing failure
1221 /// \~english @par Detail
1222 /// -clear log forcely.
1223 /// \~english @par Classification
1225 /// \~english @par Type
1229 ////////////////////////////////////////////////////////////////////////////////////////////
1230 VOID NsForceClose(void);
1237 ///////////////////////////////////////////////////////////////////////////////
1238 /// \ingroup tag_NSLogger
1239 /// \brief extern FRAMEWORKUNIFIEDLOG parameter
1240 ///////////////////////////////////////////////////////////////////////////////
1241 /// Global variable that's used by the Native Services Logger.
1242 /// An application will setup this variable in their main,
1243 /// values are user defined and provide user control of what
1244 /// should and shouldn't get logged.
1246 /// FRAMEWORKUNIFIEDLOGPARAM g_FrameworkunifiedLogParams =
1248 /// FRAMEWORKUNIFIEDLOGOPTIONS,
1250 /// ZONE_TEXT_10, ZONE_TEXT_11, ZONE_TEXT_12,
1251 /// ZONE_TEXT_13, ZONE_TEXT_14, ZONE_TEXT_15,
1252 /// ZONE_TEXT_16, ZONE_TEXT_17, ZONE_TEXT_18,
1253 /// ZONE_TEXT_19, ZONE_TEXT_20, ZONE_TEXT_21,
1254 /// ZONE_TEXT_22, ZONE_TEXT_23, ZONE_TEXT_24,
1255 /// ZONE_TEXT_25, ZONE_TEXT_26, ZONE_TEXT_27,
1256 /// ZONE_TEXT_28, ZONE_TEXT_29, ZONE_TEXT_30,
1257 /// ZONE_TEXT_31, ZONE_TEXT_32, ZONE_TEXT_33,
1258 /// ZONE_TEXT_34, ZONE_TEXT_35, ZONE_TEXT_36,
1259 /// ZONE_TEXT_37, ZONE_TEXT_38, ZONE_TEXT_39,
1260 /// ZONE_TEXT_40, ZONE_TEXT_41, ZONE_TEXT_42,
1261 /// ZONE_TEXT_43, ZONE_TEXT_44, ZONE_TEXT_45,
1262 /// ZONE_TEXT_46, ZONE_TEXT_47, ZONE_TEXT_48,
1263 /// ZONE_TEXT_49, ZONE_TEXT_50, ZONE_TEXT_51,
1264 /// ZONE_TEXT_52, ZONE_TEXT_53, ZONE_TEXT_54,
1267 /// FRAMEWORKUNIFIEDLOGZONES
1272 /// if FRAMEWORKUNIFIEDLOGZONES not defined in makefile
1273 #ifndef FRAMEWORKUNIFIEDLOGZONES
1274 ///////////////////////////////////////////////////////////////////////////////
1275 /// \ingroup tag_NSLogger
1276 /// \brief g_FrameworkunifiedLogParams
1277 /// if FRAMEWORKUNIFIEDLOGZONES not defined in makefile
1278 ///////////////////////////////////////////////////////////////////////////////
1279 #define FRAMEWORKUNIFIEDLOGZONES {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
1281 ///////////////////////////////////////////////////////////////////////////////
1282 /// \ingroup FRAMEWORKUNIFIED_SET_ZONES
1283 /// \~english @par Brief
1284 /// This macro API register FRAMEWORKUNIFIEDLOGAPPZONES.
1285 /// \~english @retval none
1286 /// \~english @par Prerequisite
1288 /// \~english @par Change of internal state
1289 /// - The internal state is not changed.
1290 /// \~english @par Conditions of processing failure
1292 /// \~english @par Detail
1293 /// in main() function use macro FRAMEWORKUNIFIED_SET_ZONES() before FrameworkunifiedDispatcher()
1294 /// \~english @par Classification
1296 /// \~english @par Type
1299 /// NsLogSetFrameworkunifiedLogParams
1300 ///////////////////////////////////////////////////////////////////////////////
1301 #define FRAMEWORKUNIFIED_SET_ZONES() {UI_32 LogArr[] = {FRAMEWORKUNIFIEDLOGAPPZONES}; \
1302 NsLogParseZones(&g_FrameworkunifiedLogParams, (UI_32)_countof(LogArr), FRAMEWORKUNIFIEDLOGAPPZONES); \
1303 NsLogSetFrameworkunifiedLogParams(&g_FrameworkunifiedLogParams);}
1305 #warning "Zones defined by FRAMEWORKUNIFIEDLOGAPPZONES are overridden by FRAMEWORKUNIFIEDLOGZONES"
1306 #define FRAMEWORKUNIFIED_SET_ZONES() NsLogSetFrameworkunifiedLogParams(&g_FrameworkunifiedLogParams)
1309 #define ZONE_END UINT_MAX
1311 // #define CHECK_SEVERITY_LEVEL(sev_level) ((sev_level) >= NsLogGetSeverity())
1312 // If value of BITS_IN_TZONE changes in future then need to consider changes in the values 5 and 0x1F in below macros
1313 // here 5 represents (sizeof(TFrameworkunifiedZone)+1) and 0x1F represents (BITS_IN_TZONE-1)
1314 #define GET_ZONE_INDEX(zone) (((UI_32)zone) >> 5)
1315 #define GET_ZONE_BIT_MASK(zone) ((TFrameworkunifiedZone)(1U << (((UI_32)zone) & 0x1F)))
1317 ///////////////////////////////////////////////////////////////////////////////
1318 /// \ingroup ZONEMASK
1319 /// \~english @par Brief
1320 /// the Macro for zone index mask
1321 /// \~english @param [in] n
1323 /// \~english @retval num
1324 /// UI_32 - zone index
1325 /// \~english @par Prerequisite
1327 /// \~english @par Change of internal state
1329 /// \~english @par Conditions of processing failure
1331 /// \~english @par Detail
1332 /// mask the zone index
1333 /// \~english @par Classification
1335 /// \~english @par Type
1339 ////////////////////////////////////////////////////////////////////////////////////////////////
1340 #define ZONEMASK( n ) ((TFrameworkunifiedZone)( n ))
1342 ///////////////////////////////////////////////////////////////////////////////
1343 /// \ingroup IS_ZONE_SET
1344 /// \~english @par Brief
1345 /// check wheather the FRAMEWORKUNIFIEDLOG ZONE is set by your application process.
1346 /// \~english @param [in] set_zone
1347 /// UI_32 - checking zone_index
1348 /// \~english @retval TRUE zone is enable
1349 /// \~english @retval FALSE zone is disable
1350 /// \~english @par Prerequisite
1352 /// \~english @par Change of internal state
1353 /// - The internal state is not changed.
1354 /// \~english @par Conditions of processing failure
1356 /// \~english @par Detail
1357 /// Checks if the FRAMEWORKUNIFIEDLOG ZONE can be configured by Application processes.
1358 /// \~english @par Classification
1360 /// \~english @par Type
1364 ////////////////////////////////////////////////////////////////////////////////////////////////
1365 #define IS_ZONE_SET(set_zone) (NsLogIsZoneSet(set_zone) == TRUE)
1367 ///////////////////////////////////////////////////////////////////////////////
1368 /// \ingroup FRAMEWORKUNIFIEDLOG
1369 /// \~english @par Brief
1370 /// Developers should use the FRAMEWORKUNIFIEDLOG for logging.
1371 /// \~english @param [in] zone
1372 /// Defined zone in a process (e.g. ZONE_FUNC)
1373 /// \~english @param [in] funcname
1374 /// Name of the class or method where the log was written (e.g. "main")
1375 /// \~english @param [in] print_fmt
1376 /// string similar to that of a printf statement
1377 /// \~english @param [in] args
1378 /// Data arguments(option)
1379 /// \~english @retval none
1380 /// \~english @par Prerequisite
1382 /// \~english @par Change of internal state
1383 /// - The internal state is not changed.
1384 /// \~english @par Conditions of processing failure
1385 /// - If print_fmt is NULL, no operation is performed.
1386 /// \~english @par Detail
1387 /// FRAMEWORKUNIFIEDLOG is simple macro to make it easy to log messages from any point in your code.
1388 /// This macro has smarts that does fast checks to determine if your log should or shouldn't be printed.
1389 /// \~english @par Classification
1391 /// \~english @par Type
1394 /// ZONEMASK, IS_ZONE_SET, NsLog, NsLog0
1395 ///////////////////////////////////////////////////////////////////////////////
1396 #ifndef _FRAMEWORKUNIFIEDLOG_ZONE_FUNC_ENABLE_
1397 #define FRAMEWORKUNIFIEDLOG(zone, funcname, print_fmt, args...)\
1398 (zone != ZONEMASK(11))?((IS_ZONE_SET(zone))?TEXT_ZONE(zone, funcname, print_fmt, ## args):((void)0)):((void)(0))
1399 #else // _FRAMEWORKUNIFIEDLOG_ZONE_FUNC_ENABLE_
1400 #define FRAMEWORKUNIFIEDLOG(zone, funcname, print_fmt, args...)\
1401 ((IS_ZONE_SET(zone)) ? TEXT_ZONE(zone, funcname, print_fmt, ## args) : ((void)0))
1402 #endif // _FRAMEWORKUNIFIEDLOG_ZONE_FUNC_ENABLE_
1404 ///////////////////////////////////////////////////////////////////////////////
1405 /// \ingroup tag_NSLogger
1406 /// \~english @par Brief
1407 /// This is the log output macro for clock display in milliseconds.
1408 /// \~english @param [in] zone
1409 /// Zone indexes to be checked
1410 /// \~english @param [in] str
1411 /// Log output string
1412 /// \~english @retval none
1413 /// \~english @par Prerequisite
1415 /// \~english @par Change of internal state
1416 /// - The internal state is not changed.
1417 /// \~english @par Conditions of processing failure
1419 /// \~english @par Detail
1420 /// A simple macro for logging messages in milliseconds from any point in the source code.\n
1421 /// The log is output in the following format. "Hours:Minutes:Seconds.Milliseconds/=log-output-string"
1422 /// \~english @par Classification
1427 ////////////////////////////////////////////////////////////////////////////////////////////////
1428 #define FRAMEWORKUNIFIEDLOG_TIME(zone, str)\
1429 ((IS_ZONE_SET(zone))?NsLogTime(zone, str):((void)(0)))
1431 ///////////////////////////////////////////////////////////////////////////////
1432 /// \ingroup tag_NSLogger
1433 /// \~english @par Brief
1434 /// This is a simplified version of the log output macro.
1435 /// \~english @param [in] zone
1436 /// Zone indexes to be checked
1437 /// \~english @param [in] data
1439 /// \~english @param [in] size
1440 /// Size of the log output data
1441 /// \~english @retval none
1442 /// \~english @par Prerequisite
1444 /// \~english @par Change of internal state
1445 /// - The internal state is not changed.
1446 /// \~english @par Conditions of processing failure
1448 /// \~english @par Detail
1449 /// A simple macro for logging messages from any point in the source code.\n
1450 /// \ref The macro FRAMEWORKUNIFIEDLOG can specify variable argument lists for log output data,
1451 /// but the macro is a macro that specifies only data character strings.
1452 /// \~english @par Classification
1455 /// IS_ZONE_SET, NsLogData
1457 ////////////////////////////////////////////////////////////////////////////////////////////////
1458 #define FRAMEWORKUNIFIEDLOG_DATA(zone, data, size)\
1459 ((IS_ZONE_SET(zone))?NsLogData(zone, data, size):((void)(0)))
1461 ///////////////////////////////////////////////////////////////////////////////
1462 /// \ingroup tag_NSLogger
1463 /// \brief FRAMEWORKUNIFIEDLOG_EVTCNT
1464 ///////////////////////////////////////////////////////////////////////////////
1465 /// Deprecated API. Not use.
1466 #define FRAMEWORKUNIFIEDLOG_EVTCNT(zone, CntId, EvtId, n...) NsLog_EvtCnt(CntId, EvtId, ##n)
1468 ///////////////////////////////////////////////////////////////////////////////
1469 /// \ingroup tag_NSLogger
1470 /// \brief FRAMEWORKUNIFIEDLOG_EVT
1471 ///////////////////////////////////////////////////////////////////////////////
1472 /// Event logger mechanism.(Send data to SS event logger Queue)
1473 /// \note The ZONE is not used.
1475 /// \param [in] zone
1476 /// Defined zone in a process (e.g. ZONE_FUNC)
1477 /// \param [in] EvtId
1478 /// UI_16 - ID of Event from comm layer
1480 /// UI_8 - number of variable arguments inputted
1481 ///////////////////////////////////////////////////////////////////////////////
1482 /// Deprecated API. Not use.
1483 #define FRAMEWORKUNIFIEDLOG_EVT(zone, EvtId, n...) NsLog_Evt(EvtId, ##n)
1485 ///////////////////////////////////////////////////////////////////////////////
1486 /// \ingroup tag_NSLogger
1487 /// \brief FRAMEWORKUNIFIEDLOG_CNT
1488 ///////////////////////////////////////////////////////////////////////////////
1489 /// Counter logger mechanism.(Send data to SS event logger Queue)
1490 /// \note The ZONE is not used.
1492 /// \param [in] zone
1493 /// Defined zone in a process (e.g. ZONE_FUNC)
1494 /// \param [in] CntId
1495 /// UI_16 - ID of Event from comm layer
1497 /// UI_8 - number of variable arguments inputted
1498 ////////////////////////////////////////////////////////////////////////////////////////////
1499 /// Deprecated API. Not use.
1500 #define FRAMEWORKUNIFIEDLOG_CNT(zone, CntId, n...) NsLog_Cnt(CntId, ##n) // Not to use
1502 /// Deprecated API. Not use.
1503 #define TEXT(funcname, args...) TEXT_ZONE(BITS_IN_ZONE_MASK, funcname, ## args)
1506 // #define TEXT0(funcname, print_fmt ) NsLog(__LINE__, BITS_IN_ZONE_MASK, funcname, print_fmt)
1508 #define GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \
1509 _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, \
1510 _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, \
1511 _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, \
1512 _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, \
1513 _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, \
1514 _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, \
1515 _71, _72, _73, _74, _75, _76, _77, _78, NAME, ...) NAME
1516 #define NsLogFunc(...)\
1517 GET_MACRO(__VA_ARGS__, \
1518 NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, \
1519 NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, \
1520 NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, \
1521 NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, \
1522 NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, \
1523 NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, \
1524 NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, \
1525 NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog, NsLog0)
1526 #define TEXT_ZONE(zone_index, funcname, ...)\
1527 NsLogFunc(__VA_ARGS__)(__LINE__, zone_index, funcname, __VA_ARGS__)
1529 /// Deprecated API. Not use.
1530 #define TEXT_EVTCNT(CntId, EvtId, n...) NsLog_EvtCnt(CntId, EvtId, ##n)
1531 /// Deprecated API. Not use
1532 #define TEXT_EVT(EvtID, n...) NsLog_Evt(EvtID, ##n)
1533 /// Deprecated API. Not use.
1534 #define TEXT_CNT(CntId, n...) NsLog_Cnt(CntId, ##n)
1535 /// Used to log data that contains trailing arguments \n
1536 /// Example: FRAMEWORKUNIFIEDLOG0(ZONE_INFO, __FUNCTION__, "testers return value is [%d]!", rtnValue);
1539 /// Deprecated API. Use FRAMEWORKUNIFIEDLOG instead.
1540 #define FRAMEWORKUNIFIEDLOG0 FRAMEWORKUNIFIEDLOG
1543 /// Note: These bits are reserved for Framework logging and debugging
1544 #define ZONE_NS_FUNC ZONEMASK(0)
1545 #define ZONE_NS_DIS ZONEMASK(1)
1546 #define ZONE_NS__CWORD77_ ZONEMASK(2)
1547 #define ZONE_NS_IMP_INFO ZONEMASK(3)
1548 #define ZONE_NS_SM_DEV_INFO ZONEMASK(4)
1549 #define ZONE_NS_SM_USR_INFO ZONEMASK(5)
1550 #define ZONE_NS_INFO ZONEMASK(6)
1551 #define ZONE_NS_DEBUG_DUMP ZONEMASK(7)
1552 #define ZONE_NS_WAR ZONEMASK(8)
1553 #define ZONE_NS_ERR ZONEMASK(9)
1554 #define ZONE_DEBUG_DUMP ZONE_NS_DEBUG_DUMP
1556 #define ZONE_TEXT_0 "NS_Func"
1557 #define ZONE_TEXT_1 "NS_Dispatcher"
1558 #define ZONE_TEXT_2 "NS__CWORD77_"
1559 #define ZONE_TEXT_3 "NS_Reserved"
1560 #define ZONE_TEXT_4 "NS_StateMachine_Dev"
1561 #define ZONE_TEXT_5 "NS_StateMachine_Usr"
1562 #define ZONE_TEXT_6 "NS_Info"
1563 #define ZONE_TEXT_7 "NS_Debug_Dump"
1564 #define ZONE_TEXT_8 "NS_Warning"
1565 #define ZONE_TEXT_9 "NS_Error"
1568 // Following is old definitions. Only for compile.
1569 // Specific ZONE to use the ns_logger_frameworkunifiedlog.cfg
1570 // If possible, following Specific ZONE difinitions shall be delete.
1572 // Special ZONE(64)-(95)
1573 /// Note: These bits are reserved for special ZONE
1574 #define ZONE_PERFORMANCE ZONEMASK(64)
1575 #define ZONE_SCREEN_TRANS ZONEMASK(65)
1576 #define ZONE_SWDL ZONEMASK(66)
1577 #define ZONE_SYSTEMDATA ZONEMASK(67)
1578 #define ZONE_LOG_SH ZONEMASK(68)
1579 #define ZONE_LOG_SYS ZONEMASK(69)
1580 #define ZONE_LOG__CWORD52_ ZONEMASK(70)
1581 #define ZONE_SECURE ZONEMASK(71)
1582 #define ZONE_CAN_FILTER ZONEMASK(72)
1583 #define ZONE_COMM_PROCESS ZONEMASK(73)
1584 #define ZONE_CONNECT_DEVICE ZONEMASK(74)
1585 #define ZONE_SP_ZONE_75 ZONEMASK(75)
1586 #define ZONE_SP_ZONE_76 ZONEMASK(76)
1587 #define ZONE_SP_ZONE_77 ZONEMASK(77)
1588 #define ZONE_SP_ZONE_78 ZONEMASK(78)
1589 #define ZONE_SP_ZONE_79 ZONEMASK(79)
1590 #define ZONE_SP_ZONE_80 ZONEMASK(80)
1591 #define ZONE_SP_ZONE_81 ZONEMASK(81)
1592 #define ZONE_SP_ZONE_82 ZONEMASK(82)
1593 #define ZONE_SP_ZONE_83 ZONEMASK(83)
1594 #define ZONE_SP_ZONE_84 ZONEMASK(84)
1595 #define ZONE_SP_ZONE_85 ZONEMASK(85)
1596 #define ZONE_SP_ZONE_86 ZONEMASK(86)
1597 #define ZONE_SP_ZONE_87 ZONEMASK(87)
1598 #define ZONE_SP_ZONE_88 ZONEMASK(88)
1599 #define ZONE_SP_ZONE_89 ZONEMASK(89)
1600 #define ZONE_SP_ZONE_90 ZONEMASK(90)
1601 #define ZONE_SP_ZONE_91 ZONEMASK(91)
1602 #define ZONE_SP_ZONE_92 ZONEMASK(92)
1603 #define ZONE_SP_ZONE_93 ZONEMASK(93)
1604 #define ZONE_SP_ZONE_94 ZONEMASK(94)
1605 #define ZONE_SP_ZONE_95 ZONEMASK(95)
1607 // Special ZONE(96)-(127) (console off)
1608 /// Note: These bits are reserved for special ZONE
1609 #define ZONE_COMM_SYS ZONEMASK(96)
1610 #define ZONE_COMM_SH ZONEMASK(97)
1611 #define ZONE_COMM_USB ZONEMASK(98)
1612 #define ZONE_SP_ZONE_99 ZONEMASK(99)
1613 #define ZONE_SP_ZONE_100 ZONEMASK(100)
1614 #define ZONE_SP_ZONE_101 ZONEMASK(101)
1615 #define ZONE_SP_ZONE_102 ZONEMASK(102)
1616 #define ZONE_SP_ZONE_103 ZONEMASK(103)
1617 #define ZONE_SP_ZONE_104 ZONEMASK(104)
1618 #define ZONE_SP_ZONE_105 ZONEMASK(105)
1619 #define ZONE_SP_ZONE_106 ZONEMASK(106)
1620 #define ZONE_SP_ZONE_107 ZONEMASK(107)
1621 #define ZONE_SP_ZONE_108 ZONEMASK(108)
1622 #define ZONE_SP_ZONE_109 ZONEMASK(109)
1623 #define ZONE_SP_ZONE_110 ZONEMASK(110)
1624 #define ZONE_SP_ZONE_111 ZONEMASK(111)
1625 #define ZONE_SP_ZONE_112 ZONEMASK(112)
1626 #define ZONE_SP_ZONE_113 ZONEMASK(113)
1627 #define ZONE_SP_ZONE_114 ZONEMASK(114)
1628 #define ZONE_SP_ZONE_115 ZONEMASK(115)
1629 #define ZONE_SP_ZONE_116 ZONEMASK(116)
1630 #define ZONE_SP_ZONE_117 ZONEMASK(117)
1631 #define ZONE_SP_ZONE_118 ZONEMASK(118)
1632 #define ZONE_SP_ZONE_119 ZONEMASK(119)
1633 #define ZONE_SP_ZONE_120 ZONEMASK(120)
1634 #define ZONE_SP_ZONE_121 ZONEMASK(121)
1635 #define ZONE_SP_ZONE_122 ZONEMASK(122)
1636 #define ZONE_SP_ZONE_123 ZONEMASK(123)
1637 #define ZONE_SP_ZONE_124 ZONEMASK(124)
1638 #define ZONE_SP_ZONE_125 ZONEMASK(125)
1639 #define ZONE_SP_ZONE_126 ZONEMASK(126)
1640 #define ZONE_SP_ZONE_127 ZONEMASK(127)
1642 #endif /* __NATIVESERVICES_LOGGER_H__ */ // NOLINT (build/header_guard)