Changeset 1657
- Timestamp:
- 07/21/08 00:37:00 (1 month ago)
- Files:
-
- libemu/trunk/include/emu/emu_log.h (modified) (1 diff)
- libemu/trunk/src/emu_log.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libemu/trunk/include/emu/emu_log.h
r1632 r1657 49 49 void emu_log_set_logcb(struct emu_logging *el, emu_log_logcb logcb); 50 50 51 void emu_log_default_logcb(struct emu *e, enum emu_log_level level, const char *msg); 52 51 53 #define logInfo(e, format...) emu_log(e, EMU_LOG_INFO, format) 52 54 libemu/trunk/src/emu_log.c
r1632 r1657 52 52 } 53 53 memset(el, 0, sizeof(struct emu_logging)); 54 54 55 el->logcb = emu_log_default_logcb; 56 55 57 return el; 56 58 } … … 84 86 va_end(ap); 85 87 86 if ( el->logcb == NULL ) 87 { 88 const char *lev[] = {"none","\033[32;1minfo\033[0m","\033[31;1mdebug\033[0m"}; 89 fprintf(stdout,"[emu 0x%08x %s ] ",(unsigned int)e, lev[level]); 90 fprintf(stdout,"%s", message); 91 } 92 else 93 el->logcb(e, level, message); 88 el->logcb(e, level, message); 94 89 95 90 free(message); … … 100 95 el->logcb = logcb; 101 96 } 97 98 void emu_log_default_logcb(struct emu *e, enum emu_log_level level, const char *msg) 99 { 100 const char *lev[] = {"none","\033[32;1minfo\033[0m","\033[31;1mdebug\033[0m"}; 101 fprintf(stdout,"[emu 0x%08x %s ] ",(unsigned int)e, lev[level]); 102 fprintf(stdout,"%s", msg); 103 }
