diff options
author | Maxim Biro <nurupo.contributions@gmail.com> | 2017-03-02 02:38:57 -0500 |
---|---|---|
committer | Maxim Biro <nurupo.contributions@gmail.com> | 2017-06-04 16:07:03 -0400 |
commit | b0aec02225b642b2e420e634dce919beee0cd0f2 (patch) | |
tree | df290f8e2f76efda437f1455411f576b3f9f7766 /other/bootstrap_daemon/src/command_line_arguments.c | |
parent | 1e8fa85aadf602bdca3a540de09a8184f7139a6c (diff) |
Split daemon's logging backends in separate modules
Diffstat (limited to 'other/bootstrap_daemon/src/command_line_arguments.c')
-rw-r--r-- | other/bootstrap_daemon/src/command_line_arguments.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/other/bootstrap_daemon/src/command_line_arguments.c b/other/bootstrap_daemon/src/command_line_arguments.c index bf7a0f8c..dce828a7 100644 --- a/other/bootstrap_daemon/src/command_line_arguments.c +++ b/other/bootstrap_daemon/src/command_line_arguments.c | |||
@@ -40,7 +40,7 @@ static void print_help(void) | |||
40 | // 2 space ident | 40 | // 2 space ident |
41 | // make sure all lines fit into 80 columns | 41 | // make sure all lines fit into 80 columns |
42 | // make sure options are listed in alphabetical order | 42 | // make sure options are listed in alphabetical order |
43 | write_log(LOG_LEVEL_INFO, | 43 | log_write(LOG_LEVEL_INFO, |
44 | "Usage: tox-bootstrapd [OPTION]... --config=FILE_PATH\n" | 44 | "Usage: tox-bootstrapd [OPTION]... --config=FILE_PATH\n" |
45 | "\n" | 45 | "\n" |
46 | "Options:\n" | 46 | "Options:\n" |
@@ -64,7 +64,7 @@ void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path, | |||
64 | bool *run_in_foreground) | 64 | bool *run_in_foreground) |
65 | { | 65 | { |
66 | if (argc < 2) { | 66 | if (argc < 2) { |
67 | write_log(LOG_LEVEL_ERROR, "Error: No arguments provided.\n\n"); | 67 | log_write(LOG_LEVEL_ERROR, "Error: No arguments provided.\n\n"); |
68 | print_help(); | 68 | print_help(); |
69 | exit(1); | 69 | exit(1); |
70 | } | 70 | } |
@@ -112,7 +112,7 @@ void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path, | |||
112 | *log_backend = LOG_BACKEND_STDOUT; | 112 | *log_backend = LOG_BACKEND_STDOUT; |
113 | log_backend_set = true; | 113 | log_backend_set = true; |
114 | } else { | 114 | } else { |
115 | write_log(LOG_LEVEL_ERROR, "Error: Invalid BACKEND value for --log-backend option passed: %s\n\n", optarg); | 115 | log_write(LOG_LEVEL_ERROR, "Error: Invalid BACKEND value for --log-backend option passed: %s\n\n", optarg); |
116 | print_help(); | 116 | print_help(); |
117 | exit(1); | 117 | exit(1); |
118 | } | 118 | } |
@@ -120,16 +120,16 @@ void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path, | |||
120 | break; | 120 | break; |
121 | 121 | ||
122 | case 'v': | 122 | case 'v': |
123 | write_log(LOG_LEVEL_INFO, "Version: %lu\n", DAEMON_VERSION_NUMBER); | 123 | log_write(LOG_LEVEL_INFO, "Version: %lu\n", DAEMON_VERSION_NUMBER); |
124 | exit(0); | 124 | exit(0); |
125 | 125 | ||
126 | case '?': | 126 | case '?': |
127 | write_log(LOG_LEVEL_ERROR, "Error: Unrecognized option %s\n\n", argv[optind - 1]); | 127 | log_write(LOG_LEVEL_ERROR, "Error: Unrecognized option %s\n\n", argv[optind - 1]); |
128 | print_help(); | 128 | print_help(); |
129 | exit(1); | 129 | exit(1); |
130 | 130 | ||
131 | case ':': | 131 | case ':': |
132 | write_log(LOG_LEVEL_ERROR, "Error: No argument provided for option %s\n\n", argv[optind - 1]); | 132 | log_write(LOG_LEVEL_ERROR, "Error: No argument provided for option %s\n\n", argv[optind - 1]); |
133 | print_help(); | 133 | print_help(); |
134 | exit(1); | 134 | exit(1); |
135 | } | 135 | } |
@@ -140,7 +140,7 @@ void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path, | |||
140 | } | 140 | } |
141 | 141 | ||
142 | if (!cfg_file_path_set) { | 142 | if (!cfg_file_path_set) { |
143 | write_log(LOG_LEVEL_ERROR, "Error: The required --config option wasn't specified\n\n"); | 143 | log_write(LOG_LEVEL_ERROR, "Error: The required --config option wasn't specified\n\n"); |
144 | print_help(); | 144 | print_help(); |
145 | exit(1); | 145 | exit(1); |
146 | } | 146 | } |