From patchwork Fri Mar 6 13:24:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Haslam X-Patchwork-Id: 45481 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 446A9214A0 for ; Fri, 6 Mar 2015 13:26:43 +0000 (UTC) Received: by labmn12 with SMTP id mn12sf16161667lab.2 for ; Fri, 06 Mar 2015 05:26:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=KSuE7Qsvf5XAD6h6WEt3r2waEOJVPcwnYzW01538BQ4=; b=DvtHwyzdQ5MjQ89fV3MLzUQw5aFuI1pfg0/nzbyiloSXG153OUMRyrFVBDfn7RCAuz NIV0tB+zysT/ye9AHg4wWzjGfUm3A7Uz07EaATaEj1ePz1PwLG3CilRjIMufl5El3LM4 1RoQSk/icEeSMDjB9/2J5MidDZHEPRGDFOYomnvcR369563eouelrtyt7cXl/a4yx8d/ rR8D0pfa+igx4m4dhXyPEvXC5OMFNoVgQuk5QYpAiw1I1Cufw6WSQO2WzEhAhLCdpTbp ToH0fyp9xdJLALzAPI+GYCeG4kO37kchr9tL3j/XOfml+/exCDDYMFw7QuxRNIN6oImk v/bw== X-Gm-Message-State: ALoCoQkgMtAY5fFxE54ChyZSIIrkRpxtUtxqOtwWdpzBFSPkvqf36ZlZpIO95vka2Z/6dN22/wWG X-Received: by 10.112.224.12 with SMTP id qy12mr2272157lbc.10.1425648401977; Fri, 06 Mar 2015 05:26:41 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.50 with SMTP id bd18ls71194lab.108.gmail; Fri, 06 Mar 2015 05:26:41 -0800 (PST) X-Received: by 10.112.172.229 with SMTP id bf5mr12657494lbc.72.1425648401698; Fri, 06 Mar 2015 05:26:41 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id i2si7059391lam.153.2015.03.06.05.26.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Mar 2015 05:26:41 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbdu14 with SMTP id u14so36364385lbd.0 for ; Fri, 06 Mar 2015 05:26:41 -0800 (PST) X-Received: by 10.112.204.197 with SMTP id la5mr12674002lbc.29.1425648401528; Fri, 06 Mar 2015 05:26:41 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1132720lbj; Fri, 6 Mar 2015 05:26:40 -0800 (PST) X-Received: by 10.55.56.145 with SMTP id f139mr28914045qka.74.1425648400144; Fri, 06 Mar 2015 05:26:40 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id g9si9157397qca.43.2015.03.06.05.26.38 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 06 Mar 2015 05:26:40 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YTsGz-0006KH-8M; Fri, 06 Mar 2015 13:26:37 +0000 Received: from mail-we0-f170.google.com ([74.125.82.170]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YTsGu-0006HN-6V for lng-odp@lists.linaro.org; Fri, 06 Mar 2015 13:26:32 +0000 Received: by wesk11 with SMTP id k11so59369937wes.11 for ; Fri, 06 Mar 2015 05:26:26 -0800 (PST) X-Received: by 10.194.62.167 with SMTP id z7mr29799312wjr.106.1425648386727; Fri, 06 Mar 2015 05:26:26 -0800 (PST) Received: from e106441.cambridge.arm.com ([2001:41d0:a:3cb4::1]) by mx.google.com with ESMTPSA id dx11sm14930010wjb.23.2015.03.06.05.26.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Mar 2015 05:26:25 -0800 (PST) From: Stuart Haslam To: lng-odp@lists.linaro.org Date: Fri, 6 Mar 2015 13:24:52 +0000 Message-Id: <1425648292-5753-1-git-send-email-stuart.haslam@linaro.org> X-Mailer: git-send-email 2.1.1 X-Topics: patch Subject: [lng-odp] [PATCHv3] linux-generic: only print errors to stderr X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stuart.haslam@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The default logger prints all log levels to stderr. To make things easier when debugging failures change it to print only errors to stderr and everything else to stdout. Signed-off-by: Stuart Haslam Reviewed-by: Taras Kondratiuk --- v2: Fixed indentation (forgot to checkpatch v1) v3: Removed ODP_UNUSED for level as it's now used platform/linux-generic/odp_weak.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_weak.c b/platform/linux-generic/odp_weak.c index 7fa5955..f4336f0 100644 --- a/platform/linux-generic/odp_weak.c +++ b/platform/linux-generic/odp_weak.c @@ -10,13 +10,24 @@ #include ODP_WEAK_SYMBOL ODP_PRINTF_FORMAT(2, 3) -int odp_override_log(odp_log_level_e level ODP_UNUSED, const char *fmt, ...) +int odp_override_log(odp_log_level_e level, const char *fmt, ...) { va_list args; int r; + FILE *logfd; + + switch (level) { + case ODP_LOG_ERR: + case ODP_LOG_UNIMPLEMENTED: + case ODP_LOG_ABORT: + logfd = stderr; + break; + default: + logfd = stdout; + } va_start(args, fmt); - r = vfprintf(stderr, fmt, args); + r = vfprintf(logfd, fmt, args); va_end(args); return r;