int main(int argc, const char *argv[]) { pthread_t thread; FILE *file = fopen("lldb.log", "w+"); log_set_stream(file); log_set_debug_level(LLDB_LOG_LEVEL_DEBUG); LOG_DEBUG(("hello world, This is debug level.")); LOG_INFO(("hello world, This is info level.")); LOG_WARN(("hello world, This is warn level.")); LOG_ERROR(("hello world, This is error level.")); pthread_create(&thread, NULL, dummy, NULL); pthread_join(thread, NULL); fclose(file); }
/*! \param level Sets level of output. Clamped to allowable range. * \param fp Output stream. If NULL, \a stderr is used. */ void log_init(int level, FILE *fp) { log_set_level(level); log_set_stream(fp); }
//! Close the logging system. void log_exit() { log_set_stream(NULL); log_set_level(LOG_NONE); }