本文整理汇总了C++中LogEntry::Terminate方法的典型用法代码示例。如果您正苦于以下问题:C++ LogEntry::Terminate方法的具体用法?C++ LogEntry::Terminate怎么用?C++ LogEntry::Terminate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogEntry
的用法示例。
在下文中一共展示了LogEntry::Terminate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ErrorLog
VXIlogResult OSBlog::ErrorLog(const VXIchar* moduleName,
VXIunsigned errorID,
const VXIchar* format,
va_list args)
{
const VXIchar *finalModuleName =
(moduleName && moduleName[0] ? moduleName : L"UNKNOWN");
// Output the log message
LogEntry entry;
entry.AddEntrySep();
entry += channelNum;
entry.AddEntrySep();
entry += finalModuleName;
entry.AddEntrySep();
entry += errorID;
entry.AddEntrySep();
VXIlogResult rc = entry.AppendKeyValueVa(format, args);
entry.Terminate();
VXIlogResult rc2 = WriteEntry(entry);
if (rc2 != VXIlog_RESULT_SUCCESS)
rc = rc2;
// Want to warn the caller that NULL moduleName really isn't OK, but
// logged it anyway
if ((! moduleName) || (! moduleName[0]))
rc = VXIlog_RESULT_INVALID_ARGUMENT;
return rc;
}
示例2: DiagnosticLog
VXIlogResult OSBlog::DiagnosticLog(VXIunsigned tagID,
const VXIchar* subtag,
const VXIchar* format,
va_list args)
{
VXIunsigned bindex, bpos;
if (!Convert2Index(tagID, &bindex, &bpos))
return VXIlog_RESULT_INVALID_ARGUMENT;
if (! format)
return VXIlog_RESULT_SUCCESS;
// if this tag is not turned on, just return
if (!testbit(TagIDs[bindex],bpos))
return VXIlog_RESULT_SUCCESS;
if (subtag == NULL)
subtag = L"";
// Output the log message
LogEntry entry;
entry.AddEntrySep();
entry += channelNum;
entry.AddEntrySep();
entry += tagID;
entry.AddEntrySep();
entry += subtag;
entry.AddEntrySep();
VXIlogResult rc;
if (args == 0)
rc = entry.Append(format, wcslen(format));
else
rc = entry.AppendVa(format, args);
entry.Terminate();
VXIlogResult rc2 = WriteEntry(entry);
if (rc2 != VXIlog_RESULT_SUCCESS)
rc = rc2;
return rc;
}
示例3: EventLog
VXIlogResult OSBlog::EventLog(VXIunsigned eventID,
const VXIchar* format,
va_list args)
{
// Output the log message
LogEntry entry;
entry.AddEntrySep();
entry += channelNum;
entry.AddEntrySep();
entry += L"EVENT";
entry.AddEntrySep();
entry += eventID;
entry.AddEntrySep();
VXIlogResult rc = entry.AppendKeyValueVa(format, args);
entry.Terminate();
// Don't write events to stdout
VXIlogResult rc2 = WriteEntry(entry, false);
if (rc2 != VXIlog_RESULT_SUCCESS)
rc = rc2;
return rc;
}