Lines Matching refs:content
78 static void PrintLogPrefix(const LogContent& content, const LogFormat& format, std::ostream& out)
83 time_t time = content.tv_sec;
105 out << setw(MONO_WIDTH) << content.mono_sec;
108 out << setw(EPOCH_WIDTH) << content.tv_sec;
117 out << setw(MSEC_WIDTH) << (content.tv_nsec / NS2MS);
119 out << setw(USEC_WIDTH) << (content.tv_nsec / NS2US);
121 out << setw(NSEC_WIDTH) << content.tv_nsec;
128 if (content.type != LOG_KMSG) {
131 out << " " << setw(PID_WIDTH) << content.pid << " " << setw(PID_WIDTH) << content.tid;
133 out << " " << LogLevel2ShortStr(content.level) << " ";
135 out << GetLogTypePrefix(content.type);
138 out << hex << setw(DOMAIN_WIDTH) << ShortDomain(content.domain) << dec;
140 out << "/" << content.tag << ": ";
142 out << " " << content.tag << " ";
146 static void AdaptWrap(const LogContent& content, const LogFormat& format, std::ostream& out)
150 out << std::setw(PREFIX_LEN + StringToWstring(content.tag).length()) << " ";
152 PrintLogPrefix(content, format, out);
156 void LogPrintWithFormat(const LogContent& content, const LogFormat& format, std::ostream& out)
160 out << "\x1B[38;5;" << GetColor(content.level) << "m";
163 const char *pHead = content.log;
164 const char *pScan = content.log;
167 PrintLogPrefix(content, format, out);
169 // split the log content by '\n', and add log prefix(datetime, pid, tid....) to each new line
184 AdaptWrap(content, format, out);