[lxc-devel] [lxc/master] tools/lxc_monitor: removed internal logging

AustinReichert on Github lxc-bot at linuxcontainers.org
Wed Nov 29 00:04:56 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 361 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20171129/8b2db5eb/attachment.bin>
-------------- next part --------------
From b4b4ff0b23faa7710a81f2b6e47500efd4d1398a Mon Sep 17 00:00:00 2001
From: AustinReichert <austinskyreichert at utexas.edu>
Date: Tue, 28 Nov 2017 16:59:14 -0600
Subject: [PATCH] tools/lxc_monitor: removed internal logging

Signed-off-by: AustinReichert <austinskyreichert at utexas.edu>
---
 src/lxc/tools/lxc_monitor.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/lxc/tools/lxc_monitor.c b/src/lxc/tools/lxc_monitor.c
index 3e98f066b..0b094af11 100644
--- a/src/lxc/tools/lxc_monitor.c
+++ b/src/lxc/tools/lxc_monitor.c
@@ -37,8 +37,6 @@
 #include "arguments.h"
 #include "lxccontainer.h"
 
-lxc_log_define(lxc_monitor_ui, lxc);
-
 static bool quit_monitord;
 
 static int my_parser(struct lxc_arguments* args, int c, char* arg)
@@ -123,12 +121,12 @@ int main(int argc, char *argv[])
 
 			fd = lxc_monitor_open(my_args.lxcpath[i]);
 			if (fd < 0) {
-				ERROR("Unable to open monitor on path: %s", my_args.lxcpath[i]);
+				fprintf(stderr, "Unable to open monitor on path: %s\n", my_args.lxcpath[i]);
 				ret = EXIT_FAILURE;
 				continue;
 			}
 			if (write(fd, "quit", 4) < 0) {
-				SYSERROR("Unable to close monitor on path: %s", my_args.lxcpath[i]);
+				fprintf(stderr, "Unable to close monitor on path: %s\n", my_args.lxcpath[i]);
 				ret = EXIT_FAILURE;
 				close(fd);
 				continue;
@@ -141,23 +139,23 @@ int main(int argc, char *argv[])
 	len = strlen(my_args.name) + 3;
 	regexp = malloc(len + 3);
 	if (!regexp) {
-		ERROR("failed to allocate memory");
+		fprintf(stderr, "failed to allocate memory\n");
 		exit(rc_main);
 	}
 	rc_snp = snprintf(regexp, len, "^%s$", my_args.name);
 	if (rc_snp < 0 || rc_snp >= len) {
-		ERROR("Name too long");
+		fprintf(stderr, "Name too long\n");
 		goto error;
 	}
 
 	if (regcomp(&preg, regexp, REG_NOSUB|REG_EXTENDED)) {
-		ERROR("failed to compile the regex '%s'", my_args.name);
+		fprintf(stderr, "failed to compile the regex '%s'\n", my_args.name);
 		goto error;
 	}
 
 	fds = malloc(my_args.lxcpath_cnt * sizeof(struct pollfd));
 	if (!fds) {
-		SYSERROR("out of memory");
+		fprintf(stderr, "out of memory\n");
 		goto cleanup;
 	}
 


More information about the lxc-devel mailing list