diff options
Diffstat (limited to 'toxcore/logger.c')
-rw-r--r-- | toxcore/logger.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/toxcore/logger.c b/toxcore/logger.c index e700fe71..ff9146d4 100644 --- a/toxcore/logger.c +++ b/toxcore/logger.c | |||
@@ -60,8 +60,8 @@ void __attribute__((destructor)) terminate_logger() | |||
60 | 60 | ||
61 | time_t tim = time(NULL); | 61 | time_t tim = time(NULL); |
62 | 62 | ||
63 | logger_write(ERROR, "============== Closing logger ==============\n" | 63 | logger_write(ERROR, "\n============== Closing logger [%u] ==============\n" |
64 | "Time: %s", asctime(localtime(&tim))); | 64 | "Time: %s", logger_get_pid(), asctime(localtime(&tim))); |
65 | 65 | ||
66 | fclose(logger.log_file); | 66 | fclose(logger.log_file); |
67 | } | 67 | } |
@@ -96,12 +96,12 @@ int logger_init(const char* file_name, LoggerLevel level) | |||
96 | sprintf(final_l, "%s"/*.%u"*/, file_name, logger_get_pid()); | 96 | sprintf(final_l, "%s"/*.%u"*/, file_name, logger_get_pid()); |
97 | 97 | ||
98 | if ( logger.log_file ) { | 98 | if ( logger.log_file ) { |
99 | fprintf(stderr, "Error opening logger name: %s with level %d: already opened!\n", final_l, level); | 99 | fprintf(stderr, "Error opening logger name: %s with level %d: %s!\n", final_l, level, strerror(errno)); |
100 | free (final_l); | 100 | free (final_l); |
101 | return -1; | 101 | return -1; |
102 | } | 102 | } |
103 | 103 | ||
104 | logger.log_file = fopen(final_l, "wb"); | 104 | logger.log_file = fopen(final_l, "ab"); |
105 | 105 | ||
106 | if ( logger.log_file == NULL ) { | 106 | if ( logger.log_file == NULL ) { |
107 | char error[1000]; | 107 | char error[1000]; |
@@ -120,8 +120,8 @@ int logger_init(const char* file_name, LoggerLevel level) | |||
120 | 120 | ||
121 | 121 | ||
122 | time_t tim = time(NULL); | 122 | time_t tim = time(NULL); |
123 | logger_write(ERROR, "============== Starting logger ==============\n" | 123 | logger_write(ERROR, "\n============== Starting logger [%u] ==============\n" |
124 | "Time: %s", asctime(localtime(&tim))); | 124 | "Time: %s", logger_get_pid(), asctime(localtime(&tim))); |
125 | 125 | ||
126 | 126 | ||
127 | 127 | ||