log.c (356345) | log.c (361435) |
---|---|
1/* 2 * util/log.c - implementation of the log code 3 * 4 * Copyright (c) 2007, NLnet Labs. All rights reserved. 5 * 6 * This software is open source. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 60 unchanged lines hidden (view full) --- 69/** pthread key for thread ids in logfile */ 70static ub_thread_key_type logkey; 71#ifndef THREADS_DISABLED 72/** pthread mutex to protect FILE* */ 73static lock_basic_type log_lock; 74#endif 75/** the identity of this executable/process */ 76static const char* ident="unbound"; | 1/* 2 * util/log.c - implementation of the log code 3 * 4 * Copyright (c) 2007, NLnet Labs. All rights reserved. 5 * 6 * This software is open source. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 60 unchanged lines hidden (view full) --- 69/** pthread key for thread ids in logfile */ 70static ub_thread_key_type logkey; 71#ifndef THREADS_DISABLED 72/** pthread mutex to protect FILE* */ 73static lock_basic_type log_lock; 74#endif 75/** the identity of this executable/process */ 76static const char* ident="unbound"; |
77static const char* default_ident="unbound"; |
|
77#if defined(HAVE_SYSLOG_H) || defined(UB_ON_WINDOWS) 78/** are we using syslog(3) to log to */ 79static int logging_to_syslog = 0; 80#endif /* HAVE_SYSLOG_H */ 81/** print time in UTC or in secondsfrom1970 */ 82static int log_time_asc = 0; 83 84void --- 91 unchanged lines hidden (view full) --- 176 return (int)(tid?*tid:0); 177} 178 179void log_ident_set(const char* id) 180{ 181 ident = id; 182} 183 | 78#if defined(HAVE_SYSLOG_H) || defined(UB_ON_WINDOWS) 79/** are we using syslog(3) to log to */ 80static int logging_to_syslog = 0; 81#endif /* HAVE_SYSLOG_H */ 82/** print time in UTC or in secondsfrom1970 */ 83static int log_time_asc = 0; 84 85void --- 91 unchanged lines hidden (view full) --- 177 return (int)(tid?*tid:0); 178} 179 180void log_ident_set(const char* id) 181{ 182 ident = id; 183} 184 |
185void log_ident_set_default(const char* id) 186{ 187 default_ident = id; 188} 189 190void log_ident_revert_to_default() 191{ 192 ident = default_ident; 193} 194 195void log_ident_set_or_default(const char* identity) 196{ 197 if(identity == NULL || identity[0] == 0) 198 log_ident_set(default_ident); 199 else 200 log_ident_set(identity); 201} 202 |
|
184void log_set_time_asc(int use_asc) 185{ 186 log_time_asc = use_asc; 187} 188 189void* log_get_lock(void) 190{ 191 if(!key_created) --- 328 unchanged lines hidden --- | 203void log_set_time_asc(int use_asc) 204{ 205 log_time_asc = use_asc; 206} 207 208void* log_get_lock(void) 209{ 210 if(!key_created) --- 328 unchanged lines hidden --- |