1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Update srs_app_log.cpp

issue#207
This commit is contained in:
tufang14 2015-01-02 12:24:43 +08:00
parent 76e8bb2d8e
commit 629d2d8964

View file

@ -326,7 +326,6 @@ void SrsFastLog::write_log(int& fd, char *str_log, int size, int level)
// add some to the end of char.
str_log[size++] = LOG_TAIL;
str_log[size++] = 0;
// if not to file, to console and return.
if (!log_to_file_tank) {
@ -336,11 +335,11 @@ void SrsFastLog::write_log(int& fd, char *str_log, int size, int level)
// \033[33m : yellow text code in shell
// \033[0m : normal text code
if (level <= SrsLogLevel::Trace) {
printf("%s", str_log);
printf("%.*s", size, str_log);
} else if (level == SrsLogLevel::Warn) {
printf("\033[33m%s\033[0m", str_log);
printf("\033[33m%.*s\033[0m", size, str_log);
} else{
printf("\033[31m%s\033[0m", str_log);
printf("\033[31m%.*s\033[0m", size, str_log);
}
return;