summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2014-07-28 13:33:23 +0200
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2014-08-12 10:46:04 +0200
commit87936e5249b2c22eefac0acfc21696e209ee6d35 (patch)
tree1d9c39ff8ab4c101c21ffed1365800e9d58403a7 /include
parent312e8742c7a650a113180bf0564a49de03dc29c8 (diff)
downloadDLT-daemon-87936e5249b2c22eefac0acfc21696e209ee6d35.tar.gz
New Callback function in DLT library, called when log level of context is changed
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'include')
-rw-r--r--include/dlt/dlt_user.h21
-rw-r--r--include/dlt/dlt_user_macros.h8
2 files changed, 29 insertions, 0 deletions
diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h
index 7d41896..44d1ca1 100644
--- a/include/dlt/dlt_user.h
+++ b/include/dlt/dlt_user.h
@@ -186,6 +186,14 @@ typedef struct
int (*injection_callback)(uint32_t service_id, void *data, uint32_t length);
} DltUserInjectionCallback;
+typedef struct
+{
+ char contextID[DLT_ID_SIZE]; /**< Context ID */
+ int8_t log_level; /**< Log level */
+ int8_t trace_status; /**< Trace status */
+ void (*log_level_changed_callback) (char context_id[DLT_ID_SIZE],uint8_t log_level,uint8_t trace_status);
+} DltUserLogLevelChangedCallback;
+
/**
* This structure is used in a table managing all contexts and the corresponding log levels in an application.
*/
@@ -199,6 +207,10 @@ typedef struct
char *context_description; /**< description of context */
DltUserInjectionCallback *injection_table; /**< Table with pointer to injection functions and service ids */
uint32_t nrcallbacks;
+
+ // Log Level changed callback
+ void (*log_level_changed_callback) (char context_id[DLT_ID_SIZE],uint8_t log_level,uint8_t trace_status);
+
} dlt_ll_ts_type;
/**
@@ -537,6 +549,15 @@ int dlt_register_injection_callback(DltContext *handle, uint32_t service_id,
int (*dlt_injection_callback)(uint32_t service_id, void *data, uint32_t length));
/**
+ * Register callback function called when log level of context was changed
+ * @param handle pointer to an object containing information about one special logging context
+ * @param (*dlt_log_level_changed_callback) function pointer to callback function
+ * @return negative value if there was an error
+ */
+int dlt_register_log_level_changed_callback(DltContext *handle,
+ void (*dlt_log_level_changed_callback)(char context_id[DLT_ID_SIZE],uint8_t log_level, uint8_t trace_status));
+
+/**
* Switch to verbose mode
*
*/
diff --git a/include/dlt/dlt_user_macros.h b/include/dlt/dlt_user_macros.h
index 37a8ccf..8a186ae 100644
--- a/include/dlt/dlt_user_macros.h
+++ b/include/dlt/dlt_user_macros.h
@@ -149,6 +149,14 @@ extern DltContext CONTEXT;
dlt_register_injection_callback(&(CONTEXT),SERVICEID, CALLBACK);} while(0)
/**
+ * Register callback function called when log level of context was changed
+ * @param CONTEXT object containing information about one special logging context
+ * @param CALLBACK function pointer to callback function
+ */
+#define DLT_REGISTER_LOG_LEVEL_CHANGED_CALLBACK(CONTEXT, CALLBACK) do{\
+ dlt_register_log_level_changed_callback(&(CONTEXT),CALLBACK);} while(0)
+
+/**
* Send log message with variable list of messages (intended for verbose mode)
* @param CONTEXT object containing information about one special logging context
* @param LOGLEVEL the log level of the log message