net/bnxt: modify default egress rule for VF representor
[dpdk.git] / lib / librte_eal / include / rte_log.h
index c020a3d..eaf66e4 100644 (file)
@@ -158,10 +158,10 @@ __rte_experimental
 bool rte_log_can_log(uint32_t logtype, uint32_t loglevel);
 
 /**
- * Set the log level for a given type based on shell pattern.
+ * Set the log level for a given type based on globbing pattern.
  *
  * @param pattern
- *   The match pattern identifying the log type.
+ *   The globbing pattern identifying the log type.
  * @param level
  *   The level to be set.
  * @return
@@ -376,6 +376,30 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
                 RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) :     \
         0)
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Register a dynamic log type in constructor context with its name and level.
+ *
+ * It is a wrapper macro for declaring the logtype, register the log and
+ * sets it's level in the constructor context.
+ *
+ * @param type
+ *   The log type identifier
+ * @param name
+ *    Name for the log type to be registered
+ * @param level
+ *   Log level. A value between EMERG (1) and DEBUG (8).
+ */
+#define RTE_LOG_REGISTER(type, name, level)                            \
+int type;                                                              \
+RTE_INIT(__##type)                                                     \
+{                                                                      \
+       type = rte_log_register_type_and_pick_level(RTE_STR(name),      \
+                                                   RTE_LOG_##level);   \
+}
+
 #ifdef __cplusplus
 }
 #endif