liblash

A bianry tree implementation used for game development from scratch
git clone git://holbrook.no/liblash.git
Log | Files | Refs | LICENSE

debuglog.c (891B)


      1 #include <stdio.h>
      2 
      3 #include "../debug_log.h"
      4 
      5 int main() {
      6 	lash_debug_log_t log;
      7 	lash_debug_log_t log2;
      8 	if (lash_debugLogInit(&log, 0) != 0)
      9 		return 1;
     10 		
     11 	if (lash_debugLogInit(&log2, 1) != 0)
     12 		return 1;
     13 		
     14 	lash_debugLogAdd(&log, "main", LASH_DEBUG_LOG_LEVEL_CRITICAL, "Test of description");
     15 	lash_debugLogAdd(&log, "main 2", LASH_DEBUG_LOG_LEVEL_MESSAGE, "Test of description 2");
     16 	
     17 	lash_debugLogAdd(&log2, "main 3", LASH_DEBUG_LOG_LEVEL_MESSAGE, "Test of description with autoflush");
     18 	
     19 	sprintf(log2.error_string_buffer, "Test of buffer %d", 123);
     20 	lash_debugLogAdd(&log2, "main 4", LASH_DEBUG_LOG_LEVEL_MESSAGE, NULL);
     21 	
     22 	sprintf(log2.error_string_buffer, "Test of buffer %d", 456);
     23 	lash_debugLogAdd(&log2, "main 5", LASH_DEBUG_LOG_LEVEL_MESSAGE, "Test of description override buffer");
     24 	
     25 	lash_debugLogAdd(&log2, "main 6", LASH_DEBUG_LOG_LEVEL_MESSAGE, NULL);
     26 	
     27 	return 0;
     28 }