From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mogw0838.ocn.ad.jp (mogw0838.ocn.ad.jp [153.149.234.39]) by dpdk.org (Postfix) with ESMTP id 3A8682BF2 for ; Tue, 6 Mar 2018 11:51:34 +0100 (CET) Received: from mf-smf-ucb021c2 (mf-smf-ucb021c2.ocn.ad.jp [153.153.66.137]) by mogw0838.ocn.ad.jp (Postfix) with ESMTP id E8E95100317; Tue, 6 Mar 2018 19:51:32 +0900 (JST) Received: from ntt.pod01.mv-mta-ucb025 ([153.149.142.99]) by mf-smf-ucb021c2 with ESMTP id tABweXSqdmLxFtABweK5XU; Tue, 06 Mar 2018 19:51:32 +0900 Received: from smtp.ocn.ne.jp ([153.149.227.165]) by ntt.pod01.mv-mta-ucb025 with id JarY1x00B3akymp01arYbf; Tue, 06 Mar 2018 10:51:32 +0000 Received: from localhost.localdomain (sp1-66-103-93.msc.spmode.ne.jp [1.66.103.93]) by smtp.ocn.ne.jp (Postfix) with ESMTPA; Tue, 6 Mar 2018 19:51:32 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: ferruh.yigit@intel.com, spp@dpdk.org Cc: Yasufumi Ogawa Date: Tue, 6 Mar 2018 19:50:55 +0900 Message-Id: <20180306105055.65210-14-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20180306105055.65210-1-ogawa.yasufumi@lab.ntt.co.jp> References: <20180306105055.65210-1-ogawa.yasufumi@lab.ntt.co.jp> Subject: [spp] [PATCH 13/13] controller: create log directory X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2018 10:51:34 -0000 From: Yasufumi Ogawa To avoid error for no existing log directory, add creating the directory while launching controller if it is not exist. Signed-off-by: Yasufumi Ogawa --- src/controller/spp_common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/controller/spp_common.py b/src/controller/spp_common.py index 3a92d75..59ba504 100644 --- a/src/controller/spp_common.py +++ b/src/controller/spp_common.py @@ -5,6 +5,8 @@ from Queue import Queue # Setup logger object logger = logging.getLogger(__name__) # handler = logging.StreamHandler() +os.system("mkdir -p %s/log" % (os.path.dirname(__file__))) + logfile = '%s/log/%s' % (os.path.dirname(__file__), 'spp.log') handler = logging.FileHandler(logfile) handler.setLevel(logging.DEBUG) -- 2.13.1