This is the first working version of the new logging system. Some work
in fine tuning still needs to be done. But is reasonably OK now.
This commit is contained in:
@ -201,18 +201,18 @@ size_t get_size_of_files(char *glob) {
|
||||
while (read(pipefd[0], &buff, 1) > 0) {
|
||||
DynStringConcatChar(s, buff);
|
||||
if (buff == '\n') {
|
||||
SICSLogWrite(GetCharArray(s), eLog);
|
||||
Log(DEBUG,"sys","%s",GetCharArray(s));
|
||||
int this_size = atoi(GetCharArray(s));
|
||||
total_size += this_size;
|
||||
DynStringClear(s);
|
||||
}
|
||||
}
|
||||
if (GetDynStringLength(s) > 0)
|
||||
SICSLogWrite(GetCharArray(s), eLogError);
|
||||
Log(DEBUG,"sys","%s",GetCharArray(s));
|
||||
DeleteDynString(s);
|
||||
close(pipefd[0]);
|
||||
waitpid(child_pid, NULL, 0);
|
||||
SICSLogPrintf(eLog, "Total size of files \"%s\" is %ldK", glob, (long int)total_size);
|
||||
Log(DEBUG,"sys", "Total size of files \"%s\" is %ldK", glob, (long int)total_size);
|
||||
return total_size;
|
||||
}
|
||||
}
|
||||
@ -260,7 +260,7 @@ void generate_stack_trace(int full, int dump) {
|
||||
while (read(pipefd[0], &buff, 1) > 0) {
|
||||
DynStringConcatChar(s, buff);
|
||||
}
|
||||
SICSLogWrite(GetCharArray(s), eLogError);
|
||||
Log(DEBUG,"sys","%s",GetCharArray(s));
|
||||
DeleteDynString(s);
|
||||
close(pipefd[0]);
|
||||
waitpid(child_pid, NULL, 0);
|
||||
|
Reference in New Issue
Block a user