From patchwork Sat Feb 16 13:54:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 220960 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C9A9A2C008D for ; Sun, 17 Feb 2013 00:54:36 +1100 (EST) Received: from localhost ([::1]:55617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6iDq-0006OK-Tu for incoming@patchwork.ozlabs.org; Sat, 16 Feb 2013 08:54:34 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6iDi-0006OB-Fu for qemu-devel@nongnu.org; Sat, 16 Feb 2013 08:54:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U6iDg-0005Wr-Gw for qemu-devel@nongnu.org; Sat, 16 Feb 2013 08:54:26 -0500 Received: from cantor2.suse.de ([195.135.220.15]:37251 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6iDg-0005WX-Aa for qemu-devel@nongnu.org; Sat, 16 Feb 2013 08:54:24 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4B3B5A3A49; Sat, 16 Feb 2013 14:54:23 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sat, 16 Feb 2013 14:54:07 +0100 Message-Id: <1361022848-5300-1-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: blauwirbel@gmail.com, peter.maydell@linaro.org, armbru@redhat.com, stefanha@redhat.com, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH] qemu-log: Introduce qemu_log_mask_vprintf() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Corresponds to existing qemu_log_vprintf() but uses a mask. Signed-off-by: Andreas Färber --- include/qemu/log.h | 8 ++++++++ 1 Datei geändert, 8 Zeilen hinzugefügt(+) diff --git a/include/qemu/log.h b/include/qemu/log.h index 58f69cb..4bfa60c 100644 --- a/include/qemu/log.h +++ b/include/qemu/log.h @@ -64,6 +64,14 @@ qemu_log_vprintf(const char *fmt, va_list va) */ void GCC_FMT_ATTR(2, 3) qemu_log_mask(int mask, const char *fmt, ...); +static inline void GCC_FMT_ATTR(2, 0) +qemu_log_mask_vprintf(int mask, const char *fmt, va_list va) +{ + if ((qemu_loglevel & mask) && qemu_logfile) { + vfprintf(qemu_logfile, fmt, va); + } +} + /* Special cases: */