X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=doc%2Fapi-ref%2Fhtml%2Fdf%2Fd76%2Fhmi-debug_8h.html;fp=doc%2Fapi-ref%2Fhtml%2Fdf%2Fd76%2Fhmi-debug_8h.html;h=22145c6c7aad89068ce501dba42b09c1bdb19bb0;hb=b2670af592e664ed304f7df77d84f1964f039636;hp=0000000000000000000000000000000000000000;hpb=ec044f44133cad1d12311345437b13b1a953226e;p=apps%2Fonscreenapp.git diff --git a/doc/api-ref/html/df/d76/hmi-debug_8h.html b/doc/api-ref/html/df/d76/hmi-debug_8h.html new file mode 100644 index 0000000..22145c6 --- /dev/null +++ b/doc/api-ref/html/df/d76/hmi-debug_8h.html @@ -0,0 +1,456 @@ + + + + + + + +OnScreenApp: app/hmi-debug.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
OnScreenApp +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+Macros | +Enumerations | +Functions | +Variables
+
+
hmi-debug.h File Reference
+
+
+
#include <time.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <stdlib.h>
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + +

+Macros

#define __FILENAME__   (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
 
#define HMI_ERROR(prefix, args, ...)   _HMI_LOG(LOG_LEVEL_ERROR, __FILENAME__, __FUNCTION__, __LINE__, prefix, args, ##__VA_ARGS__)
 
#define HMI_WARNING(prefix, args, ...)   _HMI_LOG(LOG_LEVEL_WARNING, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
 
#define HMI_NOTICE(prefix, args, ...)   _HMI_LOG(LOG_LEVEL_NOTICE, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
 
#define HMI_INFO(prefix, args, ...)   _HMI_LOG(LOG_LEVEL_INFO, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
 
#define HMI_DEBUG(prefix, args, ...)   _HMI_LOG(LOG_LEVEL_DEBUG, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
 
+ + + +

+Enumerations

enum  LOG_LEVEL {
+  LOG_LEVEL_NONE = 0, +LOG_LEVEL_ERROR, +LOG_LEVEL_WARNING, +LOG_LEVEL_NOTICE, +
+  LOG_LEVEL_INFO, +LOG_LEVEL_DEBUG, +LOG_LEVEL_MAX = LOG_LEVEL_DEBUG +
+ }
 
+ + + +

+Functions

static void _HMI_LOG (enum LOG_LEVEL level, const char *file, const char *func, const int line, const char *prefix, const char *log,...)
 
+ + + +

+Variables

static char ERROR_FLAG [6][20] = {"NONE", "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG"}
 
+

Macro Definition Documentation

+ +

◆ __FILENAME__

+ +
+
+ + + + +
#define __FILENAME__   (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
+
+ +

Definition at line 36 of file hmi-debug.h.

+ +
+
+ +

◆ HMI_DEBUG

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define HMI_DEBUG( prefix,
 args,
 ... 
)   _HMI_LOG(LOG_LEVEL_DEBUG, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
+
+ +

Definition at line 42 of file hmi-debug.h.

+ +
+
+ +

◆ HMI_ERROR

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define HMI_ERROR( prefix,
 args,
 ... 
)   _HMI_LOG(LOG_LEVEL_ERROR, __FILENAME__, __FUNCTION__, __LINE__, prefix, args, ##__VA_ARGS__)
+
+ +

Definition at line 38 of file hmi-debug.h.

+ +
+
+ +

◆ HMI_INFO

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define HMI_INFO( prefix,
 args,
 ... 
)   _HMI_LOG(LOG_LEVEL_INFO, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
+
+ +

Definition at line 41 of file hmi-debug.h.

+ +
+
+ +

◆ HMI_NOTICE

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define HMI_NOTICE( prefix,
 args,
 ... 
)   _HMI_LOG(LOG_LEVEL_NOTICE, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
+
+ +

Definition at line 40 of file hmi-debug.h.

+ +
+
+ +

◆ HMI_WARNING

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define HMI_WARNING( prefix,
 args,
 ... 
)   _HMI_LOG(LOG_LEVEL_WARNING, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
+
+ +

Definition at line 39 of file hmi-debug.h.

+ +
+
+

Enumeration Type Documentation

+ +

◆ LOG_LEVEL

+ +
+
+ + + + +
enum LOG_LEVEL
+
+ + + + + + + + +
Enumerator
LOG_LEVEL_NONE 
LOG_LEVEL_ERROR 
LOG_LEVEL_WARNING 
LOG_LEVEL_NOTICE 
LOG_LEVEL_INFO 
LOG_LEVEL_DEBUG 
LOG_LEVEL_MAX 
+ +

Definition at line 26 of file hmi-debug.h.

+ +
+
+

Function Documentation

+ +

◆ _HMI_LOG()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static void _HMI_LOG (enum LOG_LEVEL level,
const char * file,
const char * func,
const int line,
const char * prefix,
const char * log,
 ... 
)
+
+static
+
+ +

Definition at line 46 of file hmi-debug.h.

+
47 {
48  const int log_level = (getenv("USE_HMI_DEBUG") == NULL)?LOG_LEVEL_ERROR:atoi(getenv("USE_HMI_DEBUG"));
49  if(log_level < level)
50  {
51  return;
52  }
53 
54  char *message;
55  struct timespec tp;
56  unsigned int time;
57 
58  clock_gettime(CLOCK_REALTIME, &tp);
59  time = (tp.tv_sec * 1000000L) + (tp.tv_nsec / 1000);
60 
61  va_list args;
62  va_start(args, log);
63  if (log == NULL || vasprintf(&message, log, args) < 0)
64  message = NULL;
65  fprintf(stderr, "[%10.3f] [%s %s] [%s, %s(), Line:%d] >>> %s \n", time / 1000.0, prefix, ERROR_FLAG[level], file, func, line, message);
66  va_end(args);
67  free(message);
68 }
+
static char ERROR_FLAG[6][20]
Definition: hmi-debug.h:44
+
+
+
+

Variable Documentation

+ +

◆ ERROR_FLAG

+ +
+
+ + + + + +
+ + + + +
char ERROR_FLAG[6][20] = {"NONE", "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG"}
+
+static
+
+ +

Definition at line 44 of file hmi-debug.h.

+ +
+
+
+ + + +