From: Andre Noll Date: Thu, 25 Oct 2007 22:01:33 +0000 (+0200) Subject: loglevel adjustments. X-Git-Tag: v0.3.0~196 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=b3ee0fa979a74e9d7a1497ec5a3ac8fa7cc7472b;p=paraslash.git loglevel adjustments. --- diff --git a/afh_common.c b/afh_common.c index e6e77ae4..311e0c13 100644 --- a/afh_common.c +++ b/afh_common.c @@ -79,7 +79,7 @@ void afh_init(void) { int i; - PARA_DEBUG_LOG("supported audio formats: %s\n", + PARA_INFO_LOG("supported audio formats: %s\n", SUPPORTED_AUDIO_FORMATS); FOR_EACH_AUDIO_FORMAT(i) { PARA_NOTICE_LOG("initializing %s handler\n", diff --git a/afs.c b/afs.c index f619c08e..c2ac0e41 100644 --- a/afs.c +++ b/afs.c @@ -460,7 +460,7 @@ static int pass_afd(int fd, char *buf, size_t size) /* Sum of the length of all control messages in the buffer */ msg.msg_controllen = cmsg->cmsg_len; - PARA_NOTICE_LOG("passing %zu bytes and fd %d\n", size, fd); + PARA_DEBUG_LOG("passing %zu bytes and fd %d\n", size, fd); ret = sendmsg(server_socket, &msg, 0); if (ret < 0) { ret = -ERRNO_TO_PARA_ERROR(errno); @@ -487,7 +487,7 @@ int open_next_audio_file(void) int ret, shmid; char buf[8]; - PARA_NOTICE_LOG("getting next af\n"); + PARA_NOTICE_LOG("getting next audio file\n"); ret = score_get_best(&aft_row, &afd.score); if (ret < 0) return ret; @@ -495,7 +495,6 @@ int open_next_audio_file(void) if (ret < 0) return ret; shmid = ret; - PARA_NOTICE_LOG("shmid: %u\n", shmid); if (!write_ok(server_socket)) { PARA_EMERG_LOG("afs_socket not writable\n"); goto destroy; @@ -672,6 +671,8 @@ static int open_afs_tables(void) int i, ret; get_database_dir(); + PARA_NOTICE_LOG("opening %u osl tables in %s\n", NUM_AFS_TABLES, + database_dir); for (i = 0; i < NUM_AFS_TABLES; i++) { ret = afs_tables[i].open(database_dir); if (ret >= 0) @@ -830,7 +831,7 @@ static void execute_server_command(void) return; } buf[ret] = '\0'; - PARA_NOTICE_LOG("received: %s\n", buf); + PARA_DEBUG_LOG("received: %s\n", buf); if (!strcmp(buf, "new")) { ret = open_next_audio_file(); if (ret < 0) diff --git a/aft.c b/aft.c index d201c080..6d6cd8d0 100644 --- a/aft.c +++ b/aft.c @@ -379,7 +379,7 @@ static void save_chunk_table(struct audio_format_info *afhi, char *buf) { int i; - PARA_NOTICE_LOG("%lu chunks\n", afhi->chunks_total); + PARA_DEBUG_LOG("%lu chunks\n", afhi->chunks_total); for (i = 0; i <= afhi->chunks_total; i++) write_u32(buf + 4 * i, afhi->chunk_table[i]); } @@ -604,7 +604,7 @@ static int save_afd(struct audio_file_data *afd) size_t size = sizeof(*afd) + 4 * (afd->afhi.chunks_total + 1); - PARA_NOTICE_LOG("size: %zu\n", size); + PARA_DEBUG_LOG("size: %zu\n", size); int shmid, ret = shm_new(size); void *shm_afd; char *buf; @@ -787,7 +787,7 @@ static char *make_attribute_lines(const char *att_bitmap, struct afs_info *afsi) get_attribute_text(&afsi->attributes, " ", &att_text); if (!att_text) return para_strdup(att_bitmap); - att_lines = make_message("attributes: %s\nattributes_txt: %s", + att_lines = make_message("%s\nattributes_txt: %s", att_bitmap, att_text); free(att_text); return att_lines; diff --git a/mood.c b/mood.c index 46337f28..ce5c1c7e 100644 --- a/mood.c +++ b/mood.c @@ -518,7 +518,6 @@ static int load_mood(const struct osl_row *mood_row, struct mood **m) destroy_mood(mlpd.m); return ret; } - PARA_INFO_LOG("loaded mood %s\n", mlpd.m->name); *m = mlpd.m; return 1; } @@ -904,10 +903,10 @@ static void log_statistics(void) PARA_NOTICE_LOG("no admissible files\n"); return; } - PARA_NOTICE_LOG("last_played mean: %lli, last_played sigma: %llu\n", + PARA_INFO_LOG("last_played mean: %lli, last_played sigma: %llu\n", (long long int)(statistics.last_played_sum / n), (long long unsigned)int_sqrt(statistics.last_played_qd / n)); - PARA_NOTICE_LOG("num_played mean: %lli, num_played sigma: %llu\n", + PARA_INFO_LOG("num_played mean: %lli, num_played sigma: %llu\n", (long long int)statistics.num_played_sum / n, (long long unsigned)int_sqrt(statistics.num_played_qd / n)); } @@ -972,20 +971,19 @@ int change_current_mood(char *mood_name) current_mood = alloc_new_mood("dummy"); } aa.m = current_mood; - PARA_NOTICE_LOG("loaded mood %s\n", current_mood->name); - PARA_INFO_LOG("%s\n", "computing statistics of admissible files"); + PARA_NOTICE_LOG("computing statistics of admissible files\n"); ret = audio_file_loop(&aa, add_if_admissible); if (ret < 0) return ret; log_statistics(); - PARA_NOTICE_LOG("%d admissible files \n", statistics.num); + PARA_INFO_LOG("%d admissible files \n", statistics.num); for (i = 0; i < statistics.num; i++) { struct admissible_file_info *a = aa.array + i; ret = add_to_score_table(a->aft_row, a->score); if (ret < 0) goto out; } - PARA_NOTICE_LOG("score add complete\n"); + PARA_NOTICE_LOG("loaded mood %s\n", current_mood->name); ret = statistics.num; out: free(aa.array); diff --git a/server.c b/server.c index d16675be..d8fc48ee 100644 --- a/server.c +++ b/server.c @@ -370,7 +370,7 @@ static void init_afs(void) } -static unsigned do_inits(int argc, char **argv) +static unsigned server_init(int argc, char **argv) { /* connector's address information */ int sockfd; @@ -389,17 +389,19 @@ static unsigned do_inits(int argc, char **argv) /* become daemon */ if (conf.daemon_given) daemon_init(); - PARA_NOTICE_LOG("%s", "initializing virtual streaming system\n"); + PARA_NOTICE_LOG("initializing audio format handlers\n"); afh_init(); + PARA_NOTICE_LOG("initializing virtual streaming system\n"); vss_init(); mmd->server_pid = getpid(); setup_signal_handling(); + PARA_NOTICE_LOG("initializing the audio file selector\n"); init_afs(); mmd_lock(); /* init network socket */ - PARA_NOTICE_LOG("%s", "initializing tcp command socket\n"); + PARA_NOTICE_LOG("initializing tcp command socket\n"); sockfd = init_network(); - PARA_NOTICE_LOG("%s", "init complete\n"); + PARA_NOTICE_LOG("server init complete\n"); return sockfd; } @@ -460,7 +462,7 @@ int main(int argc, char *argv[]) struct timeval *timeout; valid_fd_012(); - sockfd = do_inits(argc, argv); + sockfd = server_init(argc, argv); repeat: FD_ZERO(&rfds); FD_ZERO(&wfds); diff --git a/vss.c b/vss.c index 20b80556..963d311b 100644 --- a/vss.c +++ b/vss.c @@ -182,7 +182,6 @@ static void vss_eof(void) int i; char *tmp; - PARA_NOTICE_LOG("EOF\n"); if (!map) { for (i = 0; senders[i].name; i++) senders[i].shutdown_clients(); @@ -367,11 +366,10 @@ static void recv_afs_result(void) struct stat statbuf; struct timeval now; - PARA_NOTICE_LOG("recv\n"); ret = recv_afs_msg(&passed_fd, &afs_code, &afs_data); if (ret < 0) goto err; - PARA_NOTICE_LOG("got the fd: %d, code: %u, shmid: %u\n", + PARA_DEBUG_LOG("got the fd: %d, code: %u, shmid: %u\n", passed_fd, afs_code, afs_data); ret = -E_BAD_AFS_CODE; if (afs_code != NEXT_AUDIO_FILE) @@ -419,7 +417,7 @@ void vss_post_select(fd_set *rfds, fd_set *wfds) recv_afs_result(); if (afsss != AFS_SOCKET_CHECK_FOR_WRITE || !FD_ISSET(afs_socket, wfds)) return; - PARA_NOTICE_LOG("requesting new socket\n"); + PARA_NOTICE_LOG("requesting new fd from afs\n"); ret = send_buffer(afs_socket, "new"); afsss = AFS_SOCKET_AFD_PENDING; }