Commit 6ea518f6 by Stéphane Graber Committed by Serge Hallyn

log: Set log_define properly

This sets lxc_log_define to what should be appropriate values for all existing binaries that call lxc_log_init. The name is lxc_<bin name>_ui for anything that's user visible and lxc_<bin name> for anything that's not. The parent is set to "lxc" for anything using the API and to the matching C file name for anything that isn't. Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 1d84dd35
......@@ -27,6 +27,8 @@
#include "list.h"
#include "log.h"
lxc_log_define(lxc_autostart_ui, lxc);
static int my_parser(struct lxc_arguments* args, int c, char* arg)
{
switch (c) {
......@@ -221,6 +223,11 @@ int main(int argc, char *argv[])
if (lxc_arguments_parse(&my_args, argc, argv))
return 1;
if (lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]))
return 1;
lxc_log_options_no_override();
count = list_defined_containers(NULL, NULL, &containers);
if (count < 0)
......
......@@ -32,7 +32,7 @@
#include "log.h"
#include "arguments.h"
lxc_log_define(lxc_cgroup_ui, lxc_cgroup);
lxc_log_define(lxc_cgroup_ui, lxc);
static int my_checker(const struct lxc_arguments* args)
{
......
......@@ -36,7 +36,7 @@
#include "conf.h"
#include "state.h"
lxc_log_define(lxc_clone, lxc);
lxc_log_define(lxc_clone_ui, lxc);
/* we pass fssize in bytes */
static uint64_t get_fssize(char *s)
......
......@@ -47,7 +47,7 @@
#include "arguments.h"
#include "commands.h"
lxc_log_define(lxc_console_ui, lxc_console);
lxc_log_define(lxc_console_ui, lxc);
static char etoc(const char *expr)
{
......
......@@ -33,7 +33,7 @@
#include "arguments.h"
#include "utils.h"
lxc_log_define(lxc_create, lxc);
lxc_log_define(lxc_create_ui, lxc);
static uint64_t get_fssize(char *s)
{
......
......@@ -29,7 +29,7 @@
#include "arguments.h"
#include "utils.h"
lxc_log_define(lxc_destroy, lxc);
lxc_log_define(lxc_destroy_ui, lxc);
static int my_parser(struct lxc_arguments* args, int c, char* arg)
{
......
......@@ -41,7 +41,7 @@
#include "start.h"
#include "utils.h"
lxc_log_define(lxc_execute_ui, lxc_execute);
lxc_log_define(lxc_execute_ui, lxc);
static struct lxc_list defines;
......
......@@ -33,7 +33,7 @@
#include "arguments.h"
lxc_log_define(lxc_freeze_ui, lxc_cgroup);
lxc_log_define(lxc_freeze_ui, lxc);
static const struct option my_longopts[] = {
LXC_COMMON_OPTIONS
......
......@@ -37,6 +37,8 @@
#include "commands.h"
#include "arguments.h"
lxc_log_define(lxc_info_ui, lxc);
static bool ips;
static bool state;
static bool pid;
......
......@@ -34,7 +34,7 @@
#include "monitor.h"
#include "arguments.h"
lxc_log_define(lxc_monitor_ui, lxc_monitor);
lxc_log_define(lxc_monitor_ui, lxc);
static bool quit_monitord;
......
......@@ -33,7 +33,7 @@
#include "arguments.h"
#include "utils.h"
lxc_log_define(lxc_snapshot, lxc);
lxc_log_define(lxc_snapshot_ui, lxc);
static char *newname;
static char *snapshot;
......
......@@ -55,7 +55,7 @@
#define OPT_SHARE_IPC OPT_USAGE+2
#define OPT_SHARE_UTS OPT_USAGE+3
lxc_log_define(lxc_start_ui, lxc_start);
lxc_log_define(lxc_start_ui, lxc);
static struct lxc_list defines;
......
......@@ -36,6 +36,8 @@
#define OPT_NO_LOCK OPT_USAGE+1
#define OPT_NO_KILL OPT_USAGE+2
lxc_log_define(lxc_stop_ui, lxc);
static int my_parser(struct lxc_arguments* args, int c, char* arg)
{
switch (c) {
......
......@@ -31,7 +31,7 @@
#include "log.h"
#include "arguments.h"
lxc_log_define(lxc_unfreeze_ui, lxc_cgroup);
lxc_log_define(lxc_unfreeze_ui, lxc);
static const struct option my_longopts[] = {
LXC_COMMON_OPTIONS
......
......@@ -34,7 +34,7 @@
#include "log.h"
#include "arguments.h"
lxc_log_define(lxc_wait_ui, lxc_monitor);
lxc_log_define(lxc_wait_ui, lxc);
static int my_checker(const struct lxc_arguments* args)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment