@cryptotaxi247 / netdata-1 / commits / c4c2294b3

less INFO messages - they are now DEBUG; fixes #459

Costa Tsaousis (ktsaou) committed Oct 18, 2016 at 02:15 UTC c4c2294b31a700b4a910b394c0fe00ea5fc65e3c
5 files changed +20 -18
src/common.c
+3 -3
@@ -224,7 +224,7 @@ int sleep_usec(unsigned long long usec) {
224
225 while (nanosleep(&req, &rem) == -1) {
226 if (likely(errno == EINTR)) {
227 - info("nanosleep() interrupted (while sleeping for %llu microseconds).", usec);
227 + debug(D_SYSTEM, "nanosleep() interrupted (while sleeping for %llu microseconds).", usec);
228 req.tv_sec = rem.tv_sec;
229 req.tv_nsec = rem.tv_nsec;
230 } else {
@@ -1121,7 +1121,7 @@ long get_system_cpus(void) {
1121
1122 procfile_close(ff);
1123
1124 - info("System has %d processors.", processors);
1124 + debug(D_SYSTEM, "System has %d processors.", processors);
1125 return processors;
1126 }
1127
@@ -1152,7 +1152,7 @@ pid_t get_system_pid_max(void) {
1152 }
1153
1154 procfile_close(ff);
1155 - info("System supports %d pids.", pid_max);
1155 + debug(D_SYSTEM, "System supports %d pids.", pid_max);
1156 return pid_max;
1157 }
1158
src/daemon.c
+4 -4
@@ -138,7 +138,7 @@ void oom_score_adj(int score) {
138 if(!done)
139 error("Cannot adjust my Out-Of-Memory score to %d.", score);
140 else
141 - info("Adjusted my Out-Of-Memory score to %d.", score);
141 + debug(D_SYSTEM, "Adjusted my Out-Of-Memory score to %d.", score);
142 }
143
144 int sched_setscheduler_idle(void) {
@@ -151,7 +151,7 @@ int sched_setscheduler_idle(void) {
151 if(i != 0)
152 error("Cannot adjust my scheduling priority to IDLE.");
153 else
154 - info("Adjusted my scheduling priority to IDLE.");
154 + debug(D_SYSTEM, "Adjusted my scheduling priority to IDLE.");
155
156 return i;
157 #else
@@ -214,14 +214,14 @@ int become_daemon(int dont_fork, const char *user)
214 // never become a problem
215 if(sched_setscheduler_idle() != 0) {
216 if(nice(19) == -1) error("Cannot lower my CPU priority.");
217 - else info("Set my nice value to 19.");
217 + else debug(D_SYSTEM, "Set my nice value to 19.");
218 }
219
220 if(user && *user) {
221 if(become_user(user, pidfd) != 0) {
222 error("Cannot become user '%s'. Continuing as we are.", user);
223 }
224 - else info("Successfully became user '%s'.", user);
224 + else debug(D_SYSTEM, "Successfully became user '%s'.", user);
225 }
226
227 if(pidfd != -1) {
src/log.h
+1
@@ -25,6 +25,7 @@
25 #define D_REGISTRY 0x00200000
26 #define D_VARIABLES 0x00400000
27 #define D_HEALTH 0x00800000
28 +#define D_SYSTEM 0x80000000
29
30 //#define DEBUG (D_WEB_CLIENT_ACCESS|D_LISTENER|D_RRD_STATS)
31 //#define DEBUG 0xffffffff
src/main.c
+11 -10
@@ -7,7 +7,7 @@ void netdata_cleanup_and_exit(int ret) {
7
8 error_log_limit_unlimited();
9
10 - info("Called: netdata_cleanup_and_exit()");
10 + debug(D_EXIT, "Called: netdata_cleanup_and_exit()");
11 #ifdef NETDATA_INTERNAL_CHECKS
12 rrdset_free_all();
13 #else
@@ -169,7 +169,7 @@ void kill_childs()
169 }
170
171 if(tc_child_pid) {
172 - info("Killing tc-qos-helper procees");
172 + debug(D_EXIT, "Killing tc-qos-helper procees");
173 if(killpid(tc_child_pid, SIGTERM) != -1)
174 waitid(P_PID, (id_t) tc_child_pid, &info, WEXITED);
175 }
@@ -460,7 +460,8 @@ int main(int argc, char **argv)
460 if(debug_flags != 0) {
461 struct rlimit rl = { RLIM_INFINITY, RLIM_INFINITY };
462 if(setrlimit(RLIMIT_CORE, &rl) != 0)
463 - info("Cannot request unlimited core dumps for debugging... Proceeding anyway...");
463 + error("Cannot request unlimited core dumps for debugging... Proceeding anyway...");
464 +
465 prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
466 }
467
@@ -520,7 +521,7 @@ int main(int argc, char **argv)
521
522 rrd_default_history_entries = (int) config_get_number("global", "history", RRD_DEFAULT_HISTORY_ENTRIES);
523 if(rrd_default_history_entries < 5 || rrd_default_history_entries > RRD_HISTORY_ENTRIES_MAX) {
523 - info("Invalid save lines %d given. Defaulting to %d.", rrd_default_history_entries, RRD_DEFAULT_HISTORY_ENTRIES);
524 + error("Invalid history entries %d given. Defaulting to %d.", rrd_default_history_entries, RRD_DEFAULT_HISTORY_ENTRIES);
525 rrd_default_history_entries = RRD_DEFAULT_HISTORY_ENTRIES;
526 }
527 else {
@@ -531,7 +532,7 @@ int main(int argc, char **argv)
532
533 rrd_update_every = (int) config_get_number("global", "update every", UPDATE_EVERY);
534 if(rrd_update_every < 1 || rrd_update_every > 600) {
534 - info("Invalid update timer %d given. Defaulting to %d.", rrd_update_every, UPDATE_EVERY_MAX);
535 + error("Invalid data collection frequency (update every) %d given. Defaulting to %d.", rrd_update_every, UPDATE_EVERY_MAX);
536 rrd_update_every = UPDATE_EVERY;
537 }
538 else debug(D_OPTIONS, "update timer set to %d.", rrd_update_every);
@@ -635,7 +636,7 @@ int main(int argc, char **argv)
636 if(debug_flags != 0) {
637 struct rlimit rl = { RLIM_INFINITY, RLIM_INFINITY };
638 if(setrlimit(RLIMIT_CORE, &rl) != 0)
638 - info("Cannot request unlimited core dumps for debugging... Proceeding anyway...");
639 + error("Cannot request unlimited core dumps for debugging... Proceeding anyway...");
640 prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
641 }
642 #endif /* NETDATA_INTERNAL_CHECKS */
@@ -655,7 +656,7 @@ int main(int argc, char **argv)
656 if(i != 0)
657 fatal("pthread_attr_setstacksize() to %zu bytes, failed with code %d.", wanted_stacksize, i);
658 else
658 - info("Successfully set pthread stacksize to %zu bytes", wanted_stacksize);
659 + debug(D_SYSTEM, "Successfully set pthread stacksize to %zu bytes", wanted_stacksize);
660 }
661
662 // ------------------------------------------------------------------------
@@ -692,7 +693,7 @@ int main(int argc, char **argv)
693 if(st->enabled) {
694 st->thread = mallocz(sizeof(pthread_t));
695
695 - info("Starting thread %s.", st->name);
696 + debug(D_SYSTEM, "Starting thread %s.", st->name);
697
698 if(pthread_create(st->thread, &attr, st->start_routine, NULL))
699 error("failed to create new thread for %s.", st->name);
@@ -700,7 +701,7 @@ int main(int argc, char **argv)
701 else if(pthread_detach(*st->thread))
702 error("Cannot request detach of newly created %s thread.", st->name);
703 }
703 - else info("Not starting thread %s.", st->name);
704 + else debug(D_SYSTEM, "Not starting thread %s.", st->name);
705 }
706
707 // ------------------------------------------------------------------------
@@ -716,7 +717,7 @@ int main(int argc, char **argv)
717 while(1) {
718 pause();
719 if(netdata_exit) {
719 - info("Exit main loop of netdata.");
720 + debug(D_EXIT, "Exit main loop of netdata.");
721 netdata_cleanup_and_exit(0);
722 exit(0);
723 }
src/popen.c
+1 -1
@@ -138,7 +138,7 @@ FILE *mypopen(const char *command, pid_t *pidptr)
138 error("pre-execution of command '%s' on pid %d: failed to set default signal handler for SIGUSR2.", command, getpid());
139 }
140
141 - info("executing command: '%s' on pid %d.", command, getpid());
141 + debug(D_CHILDS, "executing command: '%s' on pid %d.", command, getpid());
142 execl("/bin/sh", "sh", "-c", command, NULL);
143 exit(1);
144 }