Changeset 1042 for pjproject/trunk
- Timestamp:
- Mar 5, 2007 9:08:01 PM (18 years ago)
- Location:
- pjproject/trunk/pjlib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/log.h
r974 r1042 99 99 * @hideinitializer 100 100 */ 101 #define PJ_LOG(level,arg) pj_log_wrapper_##level(arg) 101 #define PJ_LOG(level,arg) do { \ 102 if (level <= pj_log_get_level()) \ 103 pj_log_wrapper_##level(arg); \ 104 } while (0) 102 105 103 106 /** … … 172 175 * @return Current log maximum level. 173 176 */ 177 #if 0 174 178 PJ_DECL(int) pj_log_get_level(void); 179 #else 180 PJ_DECL(int) pj_log_max_level; 181 #define pj_log_get_level() pj_log_max_level 182 #endif 175 183 176 184 /** -
pjproject/trunk/pjlib/src/pj/log.c
r974 r1042 25 25 #if PJ_LOG_MAX_LEVEL >= 1 26 26 27 static intlog_max_level = PJ_LOG_MAX_LEVEL;27 PJ_DEF(int) pj_log_max_level = PJ_LOG_MAX_LEVEL; 28 28 static pj_log_func *log_writer = &pj_log_write; 29 29 static unsigned log_decor = PJ_LOG_HAS_TIME | PJ_LOG_HAS_MICRO_SEC | … … 46 46 PJ_DEF(void) pj_log_set_level(int level) 47 47 { 48 log_max_level = level; 49 } 50 48 pj_log_max_level = level; 49 } 50 51 #if 0 51 52 PJ_DEF(int) pj_log_get_level(void) 52 53 { 53 return log_max_level; 54 } 54 return pj_log_max_level; 55 } 56 #endif 55 57 56 58 PJ_DEF(void) pj_log_set_log_func( pj_log_func *func ) … … 77 79 PJ_CHECK_STACK(); 78 80 79 if (level > log_max_level)81 if (level > pj_log_max_level) 80 82 return; 81 83 -
pjproject/trunk/pjlib/src/pj/os_core_unix.c
r974 r1042 1124 1124 PJ_ASSERT_RETURN(mutex, PJ_EINVAL); 1125 1125 1126 PJ_LOG(6,(mutex->obj_name, "Mutex: thread %s is trying", 1127 pj_thread_this()->obj_name)); 1128 1126 1129 status = pthread_mutex_trylock( &mutex->mutex ); 1127 1130 … … 1139 1142 pj_thread_this()->obj_name)); 1140 1143 #endif 1144 } else { 1145 PJ_LOG(6,(mutex->obj_name, "Mutex: thread %s's trylock() failed", 1146 pj_thread_this()->obj_name)); 1141 1147 } 1142 1148 -
pjproject/trunk/pjlib/src/pj/os_core_win32.c
r974 r1042 886 886 PJ_ASSERT_RETURN(mutex, PJ_EINVAL); 887 887 888 PJ_LOG(6,(mutex->obj_name, "Mutex: thread %s is trying", 889 pj_thread_this()->obj_name)); 890 888 891 #if PJ_WIN32_WINNT >= 0x0400 889 892 status=TryEnterCriticalSection(&mutex->crit) ? PJ_SUCCESS : PJ_EUNKNOWN; … … 900 903 ++mutex->nesting_level; 901 904 #endif 902 } 905 } else { 906 PJ_LOG(6,(mutex->obj_name, "Mutex: thread %s's trylock() failed", 907 pj_thread_this()->obj_name)); 908 } 909 903 910 return status; 904 911 }
Note: See TracChangeset
for help on using the changeset viewer.