[lxc-devel] [lxc/master] tools/lxc_cgroup: remove internal logging

AustinReichert on Github lxc-bot at linuxcontainers.org
Tue Nov 28 06:45:20 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/20171128/740bc996/attachment.bin>
-------------- next part --------------
From 614db2e111aaba14d60e8933b2f295844a21da80 Mon Sep 17 00:00:00 2001
From: AustinReichert <austinskyreichert at utexas.edu>
Date: Tue, 28 Nov 2017 00:43:46 -0600
Subject: [PATCH] tools/lxc_cgroup: remove internal logging

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

diff --git a/src/lxc/tools/lxc_cgroup.c b/src/lxc/tools/lxc_cgroup.c
index b8057b68c..cfd14bd8f 100644
--- a/src/lxc/tools/lxc_cgroup.c
+++ b/src/lxc/tools/lxc_cgroup.c
@@ -33,8 +33,6 @@
 #include "log.h"
 #include "lxc.h"
 
-lxc_log_define(lxc_cgroup_ui, lxc);
-
 static int my_checker(const struct lxc_arguments* args)
 {
 	if (!args->argc) {
@@ -99,26 +97,26 @@ int main(int argc, char *argv[])
 	if (my_args.rcfile) {
 		c->clear_config(c);
 		if (!c->load_config(c, my_args.rcfile)) {
-			ERROR("Failed to load rcfile");
+			fprintf(stderr, "Failed to load rcfile\n");
 			lxc_container_put(c);
 			exit(EXIT_FAILURE);
 		}
 		c->configfile = strdup(my_args.rcfile);
 		if (!c->configfile) {
-			ERROR("Out of memory setting new config filename");
+			fprintf(stderr, "Out of memory setting new config filename\n");
 			lxc_container_put(c);
 			exit(EXIT_FAILURE);
 		}
 	}
 
 	if (!c->may_control(c)) {
-		ERROR("Insufficent privileges to control %s:%s", my_args.lxcpath[0], my_args.name);
+		fprintf(stderr, "Insufficent privileges to control %s:%s\n", my_args.lxcpath[0], my_args.name);
 		lxc_container_put(c);
 		exit(EXIT_FAILURE);
 	}
 
 	if (!c->is_running(c)) {
-		ERROR("'%s:%s' is not running", my_args.lxcpath[0], my_args.name);
+		fprintf(stderr, "'%s:%s' is not running\n", my_args.lxcpath[0], my_args.name);
 		lxc_container_put(c);
 		exit(EXIT_FAILURE);
 	}
@@ -126,7 +124,7 @@ int main(int argc, char *argv[])
 	if ((my_args.argc) > 1) {
 		value = my_args.argv[1];
 		if (!c->set_cgroup_item(c, state_object, value)) {
-			ERROR("failed to assign '%s' value to '%s' for '%s'",
+			fprintf(stderr, "failed to assign '%s' value to '%s' for '%s'\n",
 				value, state_object, my_args.name);
 			lxc_container_put(c);
 			exit(EXIT_FAILURE);
@@ -135,7 +133,7 @@ int main(int argc, char *argv[])
 		char buffer[MAXPATHLEN];
 		int ret = c->get_cgroup_item(c, state_object, buffer, MAXPATHLEN);
 		if (ret < 0) {
-			ERROR("failed to retrieve value of '%s' for '%s:%s'",
+			fprintf(stderr, "failed to retrieve value of '%s' for '%s:%s'\n",
 			      state_object, my_args.lxcpath[0], my_args.name);
 			lxc_container_put(c);
 			exit(EXIT_FAILURE);


More information about the lxc-devel mailing list