diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2014-04-28 14:38:21 +0200 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2014-04-28 14:38:21 +0200 |
commit | 2f95d168e77487f4f7cace9b1c47217b3e58cfe7 (patch) | |
tree | 57871956206a5ec074bdfaebb15f694e6e97a2dd | |
parent | abbc629ee928abf48ae66fdfbbeefd6b03253950 (diff) | |
download | openlmi-scripts-2f95d168e77487f4f7cace9b1c47217b3e58cfe7.tar.gz openlmi-scripts-2f95d168e77487f4f7cace9b1c47217b3e58cfe7.tar.xz openlmi-scripts-2f95d168e77487f4f7cace9b1c47217b3e58cfe7.zip |
journald: Use proper logging facilities for verbose mode
-rw-r--r-- | commands/journald/lmi/scripts/journald/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/commands/journald/lmi/scripts/journald/__init__.py b/commands/journald/lmi/scripts/journald/__init__.py index 6863f74..b32d145 100644 --- a/commands/journald/lmi/scripts/journald/__init__.py +++ b/commands/journald/lmi/scripts/journald/__init__.py @@ -30,11 +30,13 @@ from lmi.scripts.common.errors import LmiFailed from lmi.shell import LMIIndicationListener +from lmi.scripts.common import get_logger import socket import time import random NUM_TAIL = 50 +LOG = get_logger(__name__) def list_messages(ns, reverse=False, tail=False): """ @@ -92,6 +94,8 @@ def log_message(ns, message): "LogName": "Journal", "DataFormat": message}) + LOG().info("Message has been logged.") + return 0; @@ -121,8 +125,7 @@ def watch(ns): raise LmiFailed("Failed to register indication: %s\n" % retval.errorstr) try: - print "Watching journal, press Ctrl+C to abort" - print "" + LOG().info("Watching journal, press Ctrl+C to abort\n") while True: time.sleep(1) pass |