diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2018-04-01 12:28:32 +1000 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2018-04-01 12:28:32 +1000 |
| commit | cf6ac7944d08e64a1392a9ee4ec46a3624732418 (patch) | |
| tree | 54784210f3a51955e4a25face379117684f5067c /pywal/image.py | |
| parent | d5f39135b2d054af23c0af8594ee772b2a544669 (diff) | |
general: Added logging.
Diffstat (limited to 'pywal/image.py')
| -rw-r--r-- | pywal/image.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pywal/image.py b/pywal/image.py index d62cc26..f30a82d 100644 --- a/pywal/image.py +++ b/pywal/image.py @@ -1,6 +1,7 @@ """ Get the image file. """ +import logging import os import random import sys @@ -24,7 +25,7 @@ def get_random_image(img_dir): images.remove(current_wall) elif not images: - print("error: No images found in directory.") + logging.error("No images found in directory.") sys.exit(1) random.shuffle(images) @@ -41,7 +42,7 @@ def get(img, cache_dir=CACHE_DIR): wal_img = get_random_image(img) else: - print("error: No valid image file found.") + logging.error("No valid image file found.") sys.exit(1) wal_img = os.path.abspath(wal_img) @@ -49,5 +50,5 @@ def get(img, cache_dir=CACHE_DIR): # Cache the image file path. util.save_file(wal_img, os.path.join(cache_dir, "wal")) - print("image: Using image", wal_img) + logging.info("Using image %s.", wal_img) return wal_img |
