public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: [gentoo-catalyst] [PATCH 3/4] snapshot: convert to log module
Date: Fri,  9 Oct 2015 15:36:06 -0400	[thread overview]
Message-ID: <1444419367-779-3-git-send-email-vapier@gentoo.org> (raw)
In-Reply-To: <1444419367-779-1-git-send-email-vapier@gentoo.org>

---
 catalyst/targets/snapshot.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py
index e1ca7b7..d19f4ef 100644
--- a/catalyst/targets/snapshot.py
+++ b/catalyst/targets/snapshot.py
@@ -8,6 +8,7 @@ from stat import ST_UID, ST_GID, ST_MODE
 
 from DeComp.compress import CompressMap
 
+from catalyst import log
 from catalyst.support import normpath, cmd
 from catalyst.base.targetbase import TargetBase
 from catalyst.base.genbase import GenBase
@@ -49,8 +50,8 @@ class snapshot(TargetBase, GenBase):
 
 		success = True
 		self.setup()
-		print "Creating Portage tree snapshot "+self.settings["version_stamp"]+\
-			" from "+self.settings["portdir"]+"..."
+		log.notice('Creating Portage tree snapshot %s from %s ...',
+			self.settings['version_stamp'], self.settings['portdir'])
 
 		mytmp=self.settings["tmp_path"]
 		ensure_dirs(mytmp)
@@ -61,7 +62,7 @@ class snapshot(TargetBase, GenBase):
 			target_snapshot,
 			"Snapshot failure", env=self.env)
 
-		print "Compressing Portage snapshot tarball..."
+		log.notice('Compressing Portage snapshot tarball ...')
 		compressor = CompressMap(self.settings["compress_definitions"],
 			env=self.env, default_mode=self.settings['compression_mode'])
 		infodict = compressor.create_infodict(
@@ -74,17 +75,17 @@ class snapshot(TargetBase, GenBase):
 			)
 		if not compressor.compress(infodict):
 			success = False
-			print "Snapshot compression failure"
+			log.error('Snapshot compression failure')
 		else:
 			filename = '.'.join([self.settings["snapshot_path"],
 				compressor.extension(self.settings["compression_mode"])])
-			print "COMPRESSOR success!!!! filename", filename
+			log.notice('Snapshot successfully written to %s', filename)
 			self.gen_contents_file(filename)
 			self.gen_digest_file(filename)
 
 		self.cleanup()
 		if success:
-			print "snapshot: complete!"
+			log.info('snapshot: complete!')
 		return success
 
 	def kill_chroot_pids(self):
@@ -92,12 +93,12 @@ class snapshot(TargetBase, GenBase):
 
 	@staticmethod
 	def cleanup():
-		print "Cleaning up..."
+		log.info('Cleaning up ...')
 
 	def purge(self):
 		myemp=self.settings["tmp_path"]
 		if os.path.isdir(myemp):
-			print "Emptying directory",myemp
+			log.notice('Emptying directory %s', myemp)
 			# stat the dir, delete the dir, recreate the dir and set
 			# the proper perms and ownership
 			mystat=os.stat(myemp)
-- 
2.5.2



  parent reply	other threads:[~2015-10-09 19:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09 19:36 [gentoo-catalyst] [PATCH 1/4] hash_utils: convert to log module Mike Frysinger
2015-10-09 19:36 ` [gentoo-catalyst] [PATCH 2/4] fileops: " Mike Frysinger
2015-10-09 19:36 ` Mike Frysinger [this message]
2015-10-09 19:36 ` [gentoo-catalyst] [PATCH 4/4] config: " Mike Frysinger
2015-10-09 20:38   ` Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1444419367-779-3-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gentoo-catalyst@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox