* set the log level,return 0 if success. see enum xlog_level_code */
| 449 | * set the log level,return 0 if success. see enum xlog_level_code |
| 450 | */ |
| 451 | XLOG_API int xlog_set_level(xlog_context* ctx, int level) |
| 452 | { |
| 453 | if (ctx == NULL){ |
| 454 | return -1; |
| 455 | } |
| 456 | if (level < XLOG_LEVEL_NONE) |
| 457 | level = XLOG_LEVEL_NONE; |
| 458 | if (level > XLOG_LEVEL_DETAIL) |
| 459 | level = XLOG_LEVEL_DETAIL; |
| 460 | |
| 461 | ctx->_log_level = level; |
| 462 | |
| 463 | return 0; |
| 464 | } |
| 465 | |
| 466 | /** |
| 467 | * create a new writer |
no outgoing calls
no test coverage detected