Skip to contentSkip to conversation

hashserv: improve the loglevel error message to be more helpful

PATCH New [email protected] 1 participant 1 message Feb 18, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hashserv: improve the loglevel error message to be more helpful

From: Paul Gortmaker <[email protected]>

Coming from a kernel background, I was thinking along the lines of

dmesg -n <integer>

for loglevel adjustments. So I tried various large and small and even zero number values with no luck before getting frustrated and opening up the python.

Let us save others the frustration and give a hint what the args it expects should look like.

bin/bitbake-hashserv +1 -1
index c913c4e3..4bfb7abf 100755
@@ -132,7 +132,7 @@ The following permissions are supported by the server:
 
     level = getattr(logging, args.log.upper(), None)
     if not isinstance(level, int):
-        raise ValueError("Invalid log level: %s" % args.log)
+        raise ValueError("Invalid log level: %s (Try ERROR/WARNING/INFO/DEBUG)" % args.log)
 
     logger.setLevel(level)
     console = logging.StreamHandler()
Signature · 1 line
2.25.1