summaryrefslogtreecommitdiff
path: root/pywal/colors.py
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2018-04-01 12:28:32 +1000
committerDylan Araps <dylan.araps@gmail.com>2018-04-01 12:28:32 +1000
commitcf6ac7944d08e64a1392a9ee4ec46a3624732418 (patch)
tree54784210f3a51955e4a25face379117684f5067c /pywal/colors.py
parentd5f39135b2d054af23c0af8594ee772b2a544669 (diff)
general: Added logging.
Diffstat (limited to 'pywal/colors.py')
-rw-r--r--pywal/colors.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pywal/colors.py b/pywal/colors.py
index 5472ef5..c0a0f1f 100644
--- a/pywal/colors.py
+++ b/pywal/colors.py
@@ -1,6 +1,7 @@
"""
Generate a palette using various backends.
"""
+import logging
import os
import random
import re
@@ -90,17 +91,17 @@ def get(img, light=False, backend="wal", cache_dir=CACHE_DIR):
if os.path.isfile(cache_file):
colors = theme.file(cache_file)
util.Color.alpha_num = colors["alpha"]
- print("colors: Found cached colorscheme.")
+ logging.info("Found cached colorscheme.")
else:
- print("wal: Generating a colorscheme...")
+ logging.info("Generating a colorscheme...")
if backend == "random":
backends = list_backends()
random.shuffle(backends)
backend = backends[0]
- print("wal: Using", backend, "backend.")
+ logging.info("Using %s backend.", backend)
# Dynamically import the backend we want to use.
# This keeps the dependencies "optional".
@@ -113,7 +114,7 @@ def get(img, light=False, backend="wal", cache_dir=CACHE_DIR):
colors = colors_to_dict(getattr(backend, "get")(img, light), img)
util.save_file_json(colors, cache_file)
- print("wal: Generation complete.")
+ logging.info("Generation complete.")
return colors