LingYun Studio embeded system framwork software, such as thirdparty build shell and lingyun library
guowenxue
2022-04-14 c4207b25c7e2c90a3cb25af524c17d961face86c
booster/logger.c
@@ -4,11 +4,11 @@
 *
 *       Filename:  logger.c
 *    Description:  This file is the linux infrastructural logger system library
 *
 *
 *        Version:  1.0.0(08/08/2020~)
 *         Author:  Guo Wenxue <guowenxue@gmail.com>
 *      ChangeLog:  1, Release initial version on "08/08/2020 04:24:01 PM"
 *
 *
 ********************************************************************************/
#include "logger.h"
@@ -97,9 +97,9 @@
    /* use standard error as output */
    if( !log_file || log_file[0]=='\0' || !strcmp(log_file, LOG_STDERR))
    if( !log_file || log_file[0]=='\0' || !strcmp(log_file, LOG_STDERR))
    {
        strncpy(logger->file, LOG_STDERR, FILENAME_LEN);
        strncpy(logger->file, LOG_STDERR, FILENAME_LEN);
        logger->flag |= FLAG_LOGGER_CONSOLE;
        logger->level = level;
        logger->fp = stderr;
@@ -108,13 +108,13 @@
        goto OUT;
    }
    strncpy(logger->file, log_file, FILENAME_LEN);
    strncpy(logger->file, log_file, FILENAME_LEN);
    logger->flag |= FLAG_LOGGER_FILE;
    logger->level = level;
    logger->size = log_size;
    logger->size = log_size;
    log_rollback_size = log_size <= 0 ? LOG_ROLLBACK_NONE : log_size*1024;    /* Unit KiB */
    filemode = (log_rollback_size==LOG_ROLLBACK_NONE) ? "a+" : "w+";
    logger->fp = fopen(logger->file, filemode);
@@ -169,8 +169,8 @@
    {
        log_close();
        filemode = log_rollback_size==LOG_ROLLBACK_NONE ? "a+" : "w+";
        logger->fp = fopen(logger->file, filemode);
        logger->fp = fopen(logger->file, filemode);
        if (logger->fp == NULL)
            rc = -2;
    }
@@ -316,10 +316,10 @@
    "                "
    "                "
    " ???????????????"
    "????????????????"
    "????????????????"
    "????????????????"
    "????????????????"
    "????????????????"
    "????????????????"
    "????????????????"
    "????????????????"
    "????????????????";
void logger_dump(int level, char *buf, int len)