Skip to content

Commit

Permalink
[bugfix] Modify dlog output code
Browse files Browse the repository at this point in the history
When outputting dlog using dlogutil in Tizen, garbage values are output
in the format starting with %

Signed-off-by: hyunil park <[email protected]>
  • Loading branch information
songgot committed Oct 18, 2023
1 parent 6a5eb29 commit 41c4382
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/libnnstreamer-edge/nnstreamer-edge-aitt.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "nnstreamer-edge-data.h"
#include "nnstreamer-edge-event.h"
#include "nnstreamer-edge-util.h"
#include "nnstreamer-edge-log.h"

/**
* @brief Data structure for aitt handle.
Expand Down
1 change: 1 addition & 0 deletions src/libnnstreamer-edge/nnstreamer-edge-aitt.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define __NNSTREAMER_EDGE_AITT_H__

#include "nnstreamer-edge.h"
#include "nnstreamer-edge-log.h"

#ifdef __cplusplus
extern "C" {
Expand Down
10 changes: 1 addition & 9 deletions src/libnnstreamer-edge/nnstreamer-edge-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,7 @@
#define DEBUG 0
#endif

#if defined(__TIZEN__)
#include <dlog.h>

#define _print_logd(...) dlog_print (DLOG_DEBUG, TAG_NAME, __VA_ARGS__)
#define _print_logi(...) dlog_print (DLOG_INFO, TAG_NAME, __VA_ARGS__)
#define _print_logw(...) dlog_print (DLOG_WARN, TAG_NAME, __VA_ARGS__)
#define _print_loge(...) dlog_print (DLOG_ERROR, TAG_NAME, __VA_ARGS__)
#define _print_logf(...) dlog_print (DLOG_FATAL, TAG_NAME, __VA_ARGS__)
#elif defined(__ANDROID__)
#if defined(__ANDROID__)
#include <android/log.h>

#define _print_logd(...) __android_log_print (ANDROID_LOG_DEBUG, TAG_NAME, __VA_ARGS__)
Expand Down
11 changes: 10 additions & 1 deletion src/libnnstreamer-edge/nnstreamer-edge-log.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ extern "C" {

#define TAG_NAME "nnstreamer-edge"

#if defined(__TIZEN__)
#include <dlog.h>

#define nns_edge_logd(...) dlog_print (DLOG_DEBUG, TAG_NAME, __VA_ARGS__)
#define nns_edge_logi(...) dlog_print (DLOG_INFO, TAG_NAME, __VA_ARGS__)
#define nns_edge_logw(...) dlog_print (DLOG_WARN, TAG_NAME, __VA_ARGS__)
#define nns_edge_loge(...) dlog_print (DLOG_ERROR, TAG_NAME, __VA_ARGS__)
#define nns_edge_logf(...) dlog_print (DLOG_FATAL, TAG_NAME, __VA_ARGS__)
#else
/**
* @brief Internal util function to print log message.
*/
Expand All @@ -32,7 +41,7 @@ void nns_edge_print_log (nns_edge_log_level_e level, const char *fmt, ...);
#define nns_edge_loge(...) nns_edge_print_log (NNS_EDGE_LOG_ERROR, __VA_ARGS__)
#define nns_edge_logd(...) nns_edge_print_log (NNS_EDGE_LOG_DEBUG, __VA_ARGS__)
#define nns_edge_logf(...) nns_edge_print_log (NNS_EDGE_LOG_FATAL, __VA_ARGS__)

#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
Expand Down
3 changes: 1 addition & 2 deletions src/libnnstreamer-edge/nnstreamer-edge-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#define _GNU_SOURCE
#include <stdio.h>
#include <stdarg.h>

#include "nnstreamer-edge-log.h"
#include "nnstreamer-edge-util.h"

Expand Down Expand Up @@ -170,7 +169,7 @@ nns_edge_malloc (nns_size_t size)
mem = malloc (size);

if (!mem)
nns_edge_loge ("Failed to allocate memory (%llu).", size);
nns_edge_loge ("Failed to allocate memory");

return mem;
}
Expand Down

0 comments on commit 41c4382

Please sign in to comment.