branch: externals/cpupower
commit a18d913837e4085619971e6c396cd8205f80d134
Author: smeister <[email protected]>
Commit: smeister <[email protected]>
logging control
---
cpupower.el | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/cpupower.el b/cpupower.el
index 2956494eb0..b0ce586dad 100644
--- a/cpupower.el
+++ b/cpupower.el
@@ -55,6 +55,13 @@ might need to enable this command for your user in
/etc/sudoers"
:type '(string)
:group 'cpupower)
+(defcustom cpupower-enable-logging
+ nil
+ "When non-nil, cpupower.el will log all commands it runs to the
+messages buffer"
+ :type '(boolean)
+ :group 'cpupower)
+
(defconst cpupower--compatible-versions
'("5.4")
"Versions of cpupower which cpupower.el can work with.")
@@ -108,7 +115,8 @@ cpus but currently it just finds _all_ governors."
"Execute cpupower with SUBCOMMAND arguments return the output as a string."
(with-temp-buffer
(let ((command (format "%s %s" cpupower-cmd subcommand)))
- (message "running: %s" command)
+ (when cpupower-enable-logging
+ (message "cpupower.el cmd: %s" command))
(shell-command command (current-buffer))
(buffer-string))))