summaryrefslogtreecommitdiff
path: root/toxcore/logger.c
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2014-11-18 00:46:46 +0100
committermannol <eniz_vukovic@hotmail.com>2014-11-18 00:46:46 +0100
commit386c9748d48d3bb4513e8e5c32e2b30a4d6a00d4 (patch)
tree55d0fb2e9fb6e1149317b9de355c28dd86c57014 /toxcore/logger.c
parent4e6f993e7d22865ee2ac90bd7dd3ff25b078c55c (diff)
av refactor
Diffstat (limited to 'toxcore/logger.c')
-rw-r--r--toxcore/logger.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/toxcore/logger.c b/toxcore/logger.c
index 48a2f303..db50700c 100644
--- a/toxcore/logger.c
+++ b/toxcore/logger.c
@@ -80,7 +80,7 @@ const char *logger_stringify_level(LoggerLevel level)
80 static const char *strings [] = { 80 static const char *strings [] = {
81 "INFO", 81 "INFO",
82 "DEBUG", 82 "DEBUG",
83 "WARNING", 83 "WARN",
84 "ERROR" 84 "ERROR"
85 }; 85 };
86 86
@@ -143,11 +143,26 @@ void logger_write (LoggerLevel level, const char *format, ...)
143 143
144char *logger_timestr(char *dest, size_t max_size) 144char *logger_timestr(char *dest, size_t max_size)
145{ 145{
146 uint64_t diff = (current_time_monotonic() - logger.start_time); /* ms */ 146 time_t timer;
147 struct tm* tm_info;
148
149 time(&timer);
150 tm_info = localtime(&timer);
151
152 strftime(dest, max_size, "%m:%d %H:%M:%S", tm_info);
153
154 return dest;
155
156 /*uint64_t diff = (current_time_monotonic() - logger.start_time); /* ms * /
147 snprintf(dest, max_size, "%"PRIu64"", diff); 157 snprintf(dest, max_size, "%"PRIu64"", diff);
148 158
149 return dest; 159 return dest; */
150} 160}
151 161
162char *logger_posstr (char *dest, size_t max_size, const char* file, int line)
163{
164 snprintf(dest, max_size, "%s:%d", file, line);
165 return dest;
166}
152 167
153#endif /* LOGGING */ 168#endif /* LOGGING */