From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CC91DA0613 for ; Mon, 23 Sep 2019 08:58:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C5B901B994; Mon, 23 Sep 2019 08:58:30 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 18F0B4C90 for ; Mon, 23 Sep 2019 08:58:28 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2019 23:58:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,539,1559545200"; d="scan'208";a="182436071" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga008.jf.intel.com with ESMTP; 22 Sep 2019 23:58:27 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 22 Sep 2019 23:58:27 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 22 Sep 2019 23:58:26 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.113]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.86]) with mapi id 14.03.0439.000; Mon, 23 Sep 2019 14:58:25 +0800 From: "Mo, YufengX" To: "dts@dpdk.org" , "Li, WenjieX A" , "Chen, Zhaoyan" , "Tu, Lijuan" Thread-Topic: [dts][PATCH V2 1/7] framework/logger: add pktgen logger and remove duplicate Thread-Index: AQHVcdsDgIqkM5WxeU+aeQG/XrArYKc41N2Q Date: Mon, 23 Sep 2019 06:58:25 +0000 Message-ID: References: <20190923065040.8251-1-yufengx.mo@intel.com> <20190923065040.8251-2-yufengx.mo@intel.com> In-Reply-To: <20190923065040.8251-2-yufengx.mo@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V2 1/7] framework/logger: add pktgen logger and remove duplicate X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Tested by Mo, YufengX > -----Original Message----- > From: Mo, YufengX > Sent: Monday, September 23, 2019 2:51 PM > To: dts@dpdk.org; Li, WenjieX A ; Chen, Zhaoyan <= zhaoyan.chen@intel.com>; Tu, Lijuan > Cc: Mo, YufengX > Subject: [dts][PATCH V2 1/7] framework/logger: add pktgen logger and remo= ve duplicate >=20 > code >=20 > *. remove duplicate ixia logger setting. > *. add pktgen logger setting. > *. fix typo. >=20 > Signed-off-by: yufengmx > --- > framework/logger.py | 25 +++++++++++++++++++++---- > 1 file changed, 21 insertions(+), 4 deletions(-) >=20 > diff --git a/framework/logger.py b/framework/logger.py > index 603d3aa..32dd954 100644 > --- a/framework/logger.py > +++ b/framework/logger.py > @@ -64,6 +64,9 @@ logging.DTS_IXIA_OUTPUT =3D logging.DEBUG + 5 > logging.DTS_VIRTDUT_CMD =3D logging.INFO + 6 > logging.DTS_VIRTDUT_OUTPUT =3D logging.DEBUG + 6 >=20 > +logging.DTS_PKTGEN_CMD =3D logging.INFO + 7 > +logging.DTS_PKTGEN_OUTPUT =3D logging.DEBUG + 7 > + > logging.addLevelName(logging.DTS_DUT_CMD, 'DTS_DUT_CMD') > logging.addLevelName(logging.DTS_DUT_OUTPUT, 'DTS_DUT_OUTPUT') > logging.addLevelName(logging.DTS_DUT_RESULT, 'DTS_DUT_RESULT') > @@ -84,8 +87,8 @@ logging.addLevelName(logging.SUITE_DUT_OUTPUT, 'SUITE_D= UT_OUTPUT') > logging.addLevelName(logging.SUITE_TESTER_CMD, 'SUITE_TESTER_CMD') > logging.addLevelName(logging.SUITE_TESTER_OUTPUT, 'SUITE_TESTER_OUTPUT') >=20 > -logging.addLevelName(logging.DTS_IXIA_CMD, 'DTS_IXIA_CMD') > -logging.addLevelName(logging.DTS_IXIA_OUTPUT, 'DTS_IXIA_OUTPUT') > +logging.addLevelName(logging.DTS_PKTGEN_CMD, 'DTS_PKTGEN_CMD') > +logging.addLevelName(logging.DTS_PKTGEN_OUTPUT, 'DTS_PKTGEN_OUTPUT') >=20 > date_fmt =3D '%d/%m/%Y %H:%M:%S' > RESET_COLOR =3D '\033[0m' > @@ -149,6 +152,12 @@ class BaseLoggerAdapter(logging.LoggerAdapter): > def dts_virtdut_output(self, msg, *args, **kwargs): > self.log(logging.DTS_VIRTDUT_OUTPUT, msg, *args, **kwargs) >=20 > + def dts_pktgen_cmd(self, msg, *args, **kwargs): > + self.log(logging.DTS_PKTGEN_CMD, msg, *args, **kwargs) > + > + def dts_pktgen_output(self, msg, *args, **kwargs): > + self.log(logging.DTS_PKTGEN_OUTPUT, msg, *args, **kwargs) > + >=20 > class ColorHandler(logging.StreamHandler): > """ > @@ -167,6 +176,8 @@ class ColorHandler(logging.StreamHandler): > logging.SUITE_TESTER_CMD: '', # SYSTEM > logging.DTS_IXIA_CMD: '', # SYSTEM > logging.DTS_IXIA_OUTPUT: '', # SYSTEM > + logging.DTS_PKTGEN_CMD: '', # SYSTEM > + logging.DTS_PKTGEN_OUTPUT: '', # SYSTEM > logging.DTS_VIRTDUT_CMD: '', # SYSTEM > logging.DTS_VIRTDUT_OUTPUT: '', # SYSTEM > logging.WARN: '\033[01;33m', # BOLD YELLOW > @@ -228,7 +239,7 @@ class DTSLOG(BaseLoggerAdapter): > fh.setFormatter(logging.Formatter(message_fmt, date_fmt)) > ch.setFormatter(logging.Formatter(stream_fmt, date_fmt)) >=20 > - fh.setLevel(logging.DEBUG) # file hander default level > + fh.setLevel(logging.DEBUG) # file handler default level > global verbose > if verbose is True: > ch.setLevel(logging.DEBUG) > @@ -310,6 +321,9 @@ class DTSLOG(BaseLoggerAdapter): > elif crb.startswith('ixia'): > self.info_lvl =3D logging.DTS_IXIA_CMD > self.debug_lvl =3D logging.DTS_IXIA_OUTPUT > + elif crb.startswith('pktgen'): > + self.info_lvl =3D logging.DTS_PKTGEN_CMD > + self.debug_lvl =3D logging.DTS_PKTGEN_OUTPUT > elif crb.startswith('virtdut'): > self.info_lvl =3D logging.DTS_VIRTDUT_CMD > self.debug_lvl =3D logging.DTS_VIRTDUT_OUTPUT > @@ -342,6 +356,9 @@ class DTSLOG(BaseLoggerAdapter): > elif crb =3D=3D 'ixia': > self.info_lvl =3D logging.DTS_IXIA_CMD > self.debug_lvl =3D logging.DTS_IXIA_OUTPUT > + elif crb =3D=3D 'pktgen': > + self.info_lvl =3D logging.DTS_PKTGEN_CMD > + self.debug_lvl =3D logging.DTS_PKTGEN_OUTPUT > elif crb =3D=3D 'virtdut': > self.info_lvl =3D logging.DTS_VIRTDUT_CMD > self.debug_lvl =3D logging.DTS_VIRTDUT_OUTPUT > @@ -428,7 +445,7 @@ class LogParser(object): > # only handle case log > m =3D self.case_pattern.match(line.values()[0]) > if m: > - # not determine case will start from begining > + # not determine case will start from beginning > if case_name is None: > begin =3D self.loglist.index(line) > # start from the determined case > -- > 2.21.0