Message ID | 20201118171559.106405-1-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBVVN2X6QKGQEYD7QPCY@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::53e; helo=mail-ed1-x53e.google.com; envelope-from=swupdate+bncbcxploxj6ikrbvvn2x6qkgqeyd7qpcy@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=Px77ZQAA; dkim-atps=neutral Received: from mail-ed1-x53e.google.com (mail-ed1-x53e.google.com [IPv6:2a00:1450:4864:20::53e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CbqGP3G9Mz9sPB for <incoming@patchwork.ozlabs.org>; Thu, 19 Nov 2020 04:16:11 +1100 (AEDT) Received: by mail-ed1-x53e.google.com with SMTP id i89sf1077667edd.15 for <incoming@patchwork.ozlabs.org>; Wed, 18 Nov 2020 09:16:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1605719766; cv=pass; d=google.com; s=arc-20160816; b=PHoYZihkktN0bqWuimzLgbt1icxmAPvheDKOJyypBr3QqzYH8OmOAdUFfr513Dqgji 1HSiOtfuQY6HVjoBWaT4BtHMdBk1+idDqArdvuZeDL6URnCJoCLUluDMunDsHLlmFJWe EXhGPX15q6P5P2iipKp9IfvDA1nEPAC/vdosp4j19pjJ+SOvVlOGHYzIVRwvAWdidEJh SxVe0rfpY3JDehowVszNQEXIqW3KGPkN9C1zXTGzFD9cHU23hmutCDEH0xv1ivnUhjjv oIg+6BIPmPkc7y7iKmkI8/REvkp8KIz+/UeQDk0IBN4r8E5153dQCd7c9PvCSCDrQtcb QX3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=luoO2Km8hIAxwpJPeP02z6/6xDCUPeE5JEhx8eyE8Bw=; b=qNJ8TFmQ7zTRn5wIyhh+W0GvQ3cenyEuRg18GMsjd7MdoW8EinA5YDyKm2d1gdkYwy shjVsjSH4ZZWNC1qWYgJcvjWkTfm0Mh9uqgXKhLk6hKYb9PglSoONTtFbL2fCyC5hGfj I/w++1fFPY/l4YvVhV/dSe6T6oFK9qxqEkD/OkKwr3W1EG/pctetVdFjwZzZWLL7nBoC nBfUtcU7lKOpm6/TZ7lBZmZlnQt9NoJ6XtdxEjzXRmrbsvQsNSBG8Hbvf8WBon+rRuVv hnGWTnmQyzkg9FNvBftNCWpS0e94u6QIE20wTnQanfNELZTJz5MZdLTYm5BI79PY+ZFa Z1LA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=luoO2Km8hIAxwpJPeP02z6/6xDCUPeE5JEhx8eyE8Bw=; b=Px77ZQAAPE+NpiHS8oFjJhN6ZFf0Nu2Mfvj50wBd8DLkLtMGPJ/bQYQ7/iJqLvHL9x hUVA2FIki8Hr+0MDn0UlnfxDdTfgnTH2n88kYHjpjViCcLTZ3qW2zJ7Rqpiu5S5mXRm6 +fKjDQDChkbFUM6vN/xCLgr3yP4l/iQtgrI1kRKunLz33ZTcK4tJB9EPDW1ojhlAO6UY j6htxfvgHtAg+RH+npApmkjmNk1byCNJxcNqnvMwVFep1UIymnt9a5hxrXM6DXvi1+JH lWk9bDAQtwecZ0ZsHAwD38qCyGTKOnAw23MW9U25yCnNCg39y+U+x0kvh7DBopR12HkQ ARMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=luoO2Km8hIAxwpJPeP02z6/6xDCUPeE5JEhx8eyE8Bw=; b=T/o2KxYI5/h4P4kBHr6mSFWJBpVPxSwAJ/nlE8UVe/jqTpYq9egw9eVlrwjlhrfxqc awfBBqcUroMTM1BdyzmBLe7qsIEJ/9cMFO2FVNiOQUNyqT6CnvT5DJbMwVPcuNCAdgAZ hH1ycWAV0/1ror8XwSgqKaZTXZophDmIb8tPt/tShkrljjD5ZXndTnvWYaT+JEfVHCnK sEBtQkvW+l5d8/IuBUwQ/o4lJe0jGQMjUoS4Bi1vCJH+/ShTu2asPMdY756JQT+A3whV ScmAd2u4Z0IWmIC1f+wQc7pgzNhvtsMvqKhXten9gYV/WibgjkrjLtnXcBxSz9J1HWZ3 8+cQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM530vQ1NMywYuN3twRAVTbImWC0Qm7VpDnwGt1VkOdktaNBylbdjh LOhYzQnaNn2E2qyquWV5x9U= X-Google-Smtp-Source: ABdhPJy4QeBw/4fBlHFRtcK0yKReGGis8NCPZH/U0aFSry+xZ935+KNTKU+pPmSfu6nimHQ6Hi1oIQ== X-Received: by 2002:a17:906:1e93:: with SMTP id e19mr3353597ejj.440.1605719766502; Wed, 18 Nov 2020 09:16:06 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:aa7:cc8b:: with SMTP id p11ls7026487edt.3.gmail; Wed, 18 Nov 2020 09:16:05 -0800 (PST) X-Received: by 2002:a50:930f:: with SMTP id m15mr27613766eda.112.1605719765357; Wed, 18 Nov 2020 09:16:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605719765; cv=none; d=google.com; s=arc-20160816; b=tdPX/plYA/Nl6nBPHRTBeJR8fs2/mMc+6pg4AtWWTZOEIjswNssigXWY45+ZUFXG8z 6m3nbEZfIuPJ9b7G0h5fVDKbTaC3Zc3pajFknEr4wsADs7O3Wr81zU4vsENVaOvBa8Wm cjGpJZ8MKrpjSIuDLA2b8Grh0kxSEGgy0yKIE1qR5vSj22GMPYMYJ7BwFGwK1cfyLZ2d OKhkEk0wq06R6GQUsDP1YN9RQVCG/KSdcPfzkkV+1pr9Fz6w77DR64rwtXq8Jou5mcY2 6e0jxJ7T+fYatOGJzh1/0kx7kcBIYsUdguDdUwHKeJ522ACb1LUSu1RDr9F4IK6qzXsU Q7mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=yZFhr/T1oQqdrTzaoIKSWmuvSvqD2SncuUU6Wg9wXaA=; b=ybhc8fqTnRor4YWncCXlv2OpHiVjj2k/geTyH08FcE0wDe1s6YzCa0ULTb3bNRnZnM 51McPJ4mO8d0AwT9B9I+xFOL8cS0QxC+Az2IvT/AKPV/hwduaZ0ZAYOv6tZ0gkT9+6x8 uOHtwUdlmeTxsiJIDg/6Kzpk3K8lH+2+hyoVLolgL9PQ+Skoe1vnSAha9FYK4gUTTkD2 84twmTsECx8k7uVnsRdZC2rC/LL5SpD6PkK3l73H8LqtAC7q7w2GWiBM5qNmWg4qUT8F BuPPLs13k8Tl+/W9Kf9kbZIlMqr8vny39lc2TX2ksobXVF/5JuBSaFvD/QVRIi0Ci2kf l4Zw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.10]) by gmr-mx.google.com with ESMTPS id a11si427262edq.1.2020.11.18.09.16.05 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Nov 2020 09:16:05 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.10; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4CbqGF0Ssyz1rxY9; Wed, 18 Nov 2020 18:16:05 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CbqGF07Cjz1t839; Wed, 18 Nov 2020 18:16:05 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id UWskqEpxgjZH; Wed, 18 Nov 2020 18:16:03 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Wed, 18 Nov 2020 18:16:03 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id DCC9B454078A; Wed, 18 Nov 2020 18:16:02 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id KKB2FjEvWyqL; Wed, 18 Nov 2020 18:16:00 +0100 (CET) Received: from paperino.arri.de (paperino.fritz.box [192.168.178.64]) by babic.homelinux.org (Postfix) with ESMTP id 8BE0045401AF; Wed, 18 Nov 2020 18:16:00 +0100 (CET) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de>, Christian Storm <christian.storm@siemens.com> Subject: [swupdate] [PATCH] syslog: suppress message not belonging to log Date: Wed, 18 Nov 2020 18:15:59 +0100 Message-Id: <20201118171559.106405-1-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
syslog: suppress message not belonging to log
|
expand
|
diff --git a/core/syslog.c b/core/syslog.c index f69c337..a7aa6af 100644 --- a/core/syslog.c +++ b/core/syslog.c @@ -20,8 +20,6 @@ void syslog_notifier(RECOVERY_STATUS status, int error, int level, const char *m { const char* statusMsg; - openlog("swupdate", 0, LOG_USER); - switch(status) { case IDLE: statusMsg = "IDLE"; break; case DOWNLOAD: statusMsg = "DOWNLOAD"; break; @@ -30,9 +28,15 @@ void syslog_notifier(RECOVERY_STATUS status, int error, int level, const char *m case SUCCESS: statusMsg = "SUCCESS"; break; case FAILURE: statusMsg = "FAILURE"; break; case DONE: statusMsg = "DONE"; break; - default: statusMsg = "UNKNOWN"; break; + /* + * Unknown messages are maybe for other subsystems + * and not to the logger, so silently ignore them + */ + default: return; } + openlog("swupdate", 0, LOG_USER); + int logprio = LOG_INFO; switch (level) { case ERRORLEVEL: logprio = LOG_ERR; break;
Some messages sent to the notifier are not for logging, but they are for the progress interface or they must reach a process. Currently, such as messages are not recognized and a FATAL_UNKNOWN mesagge is sent to the syslog server. This simply ignores messages that do not need to be looged. Signed-off-by: Stefano Babic <sbabic@denx.de> Reported-by: Christian Storm <christian.storm@siemens.com> --- core/syslog.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)