From patchwork Sun Sep 14 08:34:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Hall X-Patchwork-Id: 375 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id BBA425901; Sun, 14 Sep 2014 10:29:37 +0200 (CEST) Received: from mail.mhcomputing.net (master.mhcomputing.net [74.208.46.186]) by dpdk.org (Postfix) with ESMTP id 7AB2A58E0 for ; Sun, 14 Sep 2014 10:29:35 +0200 (CEST) Received: from syslog-sdn.mhcomputing.net (99-34-229-174.lightspeed.sntcca.sbcglobal.net [99.34.229.174]) by mail.mhcomputing.net (Postfix) with ESMTPSA id CAB1480C764; Sun, 14 Sep 2014 01:34:38 -0700 (PDT) From: Matthew Hall To: dev@dpdk.org Date: Sun, 14 Sep 2014 01:34:46 -0700 Message-Id: <1410683686-12389-1-git-send-email-mhall@mhcomputing.net> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] librte_log: add function to retrieve log_level X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Matthew Hall Acked-by: Bruce Richardson --- lib/librte_eal/common/eal_common_log.c | 7 +++++++ lib/librte_eal/common/include/rte_log.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index e4df0b9..d979f28 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -176,6 +176,13 @@ rte_set_log_level(uint32_t level) rte_logs.level = (uint32_t)level; } +/* Get global log level */ +uint32_t +rte_get_log_level() +{ + return rte_logs.level; +} + /* Set global log type */ void rte_set_log_type(uint32_t type, int enable) diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h index 565415a..7f1c2f9 100644 --- a/lib/librte_eal/common/include/rte_log.h +++ b/lib/librte_eal/common/include/rte_log.h @@ -130,6 +130,12 @@ int rte_openlog_stream(FILE *f); void rte_set_log_level(uint32_t level); /** + * Get the global log level. + * + */ +uint32_t rte_get_log_level(void); + +/** * Enable or disable the log type. * * @param type