本文整理汇总了C++中LogFormat函数的典型用法代码示例。如果您正苦于以下问题:C++ LogFormat函数的具体用法?C++ LogFormat怎么用?C++ LogFormat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LogFormat函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: LoadLanguageFile
static bool
LoadLanguageFile(const TCHAR *path)
{
#ifdef HAVE_NATIVE_GETTEXT
/* not supported on UNIX */
return false;
#else /* !HAVE_NATIVE_GETTEXT */
LogFormat(_T("Language: loading file '%s'"), path);
delete mo_loader;
mo_loader = new MOLoader(path);
if (mo_loader->error()) {
LogFormat(_T("Language: could not load file '%s'"), path);
delete mo_loader;
mo_loader = NULL;
return false;
}
LogFormat(_T("Loaded translations from file '%s'"), path);
mo_file = &mo_loader->get();
return true;
#endif /* !HAVE_NATIVE_GETTEXT */
}
开发者ID:MindMil,项目名称:XCSoar,代码行数:28,代码来源:LanguageGlue.cpp
示例2: LogFormat
void
Display::LoadOrientation(VerboseOperationEnvironment &env)
{
if (!Display::RotateSupported())
return;
Display::RotateInitialize();
DisplayOrientation orientation =
CommonInterface::GetUISettings().display.orientation;
#ifdef KOBO
/* on the Kobo, the display orientation must be loaded explicitly
(portrait), because the hardware default is landscape */
#else
if (orientation == DisplayOrientation::DEFAULT)
return;
#endif
if (!Display::Rotate(orientation)) {
LogFormat("Display rotation failed");
return;
}
#ifdef KOBO
event_queue->SetMouseRotation(orientation);
#endif
LogFormat("Display rotated");
CommonInterface::main_window->Initialise();
/* force the progress dialog to update its layout */
env.UpdateLayout();
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:34,代码来源:DisplayGlue.cpp
示例3: assert
bool
ALSAPCMPlayer::TryRecoverFromError(snd_pcm_t &alsa_handle, int error)
{
assert(error < 0);
if (-EPIPE == error)
LogFormat("ALSA PCM buffer underrun");
else if ((-EINTR == error) || (-ESTRPIPE == error))
LogFormat("ALSA PCM error: %s - trying to recover",
snd_strerror(error));
else {
// snd_pcm_recover() can only handle EPIPE, EINTR and ESTRPIPE
LogFormat("Unrecoverable ALSA PCM error: %s",
snd_strerror(error));
return false;
}
int recover_error = snd_pcm_recover(&alsa_handle, error, 1);
if (0 == recover_error) {
LogFormat("ALSA PCM successfully recovered");
return true;
} else {
LogFormat("snd_pcm_recover(0x%p, %d, 1) failed: %d - %s",
&alsa_handle,
error,
recover_error,
snd_strerror(recover_error));
return false;
}
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:30,代码来源:ALSAPCMPlayer.cpp
示例4: CheckLogCat
void
CheckLogCat(IOThread &io_thread)
{
LogFormat("Launching logcat");
FileDescriptor r, w;
if (!FileDescriptor::CreatePipe(r, w))
return;
pid_t pid = fork();
if (pid == 0) {
/* in the child process */
w.Duplicate(1);
execl("/system/bin/logcat", "logcat", "-v", "threadtime",
"-d", "-t", "1000", NULL);
_exit(EXIT_FAILURE);
}
if (pid < 0) {
LogFormat("Launching logcat has failed: %s", strerror(errno));
return;
}
log_cat_reader = new LogCatReader(io_thread, std::move(r), pid);
}
开发者ID:robertscottbeattie,项目名称:xcsoardev,代码行数:26,代码来源:LogCat.cpp
示例5: ReadResourceLanguageFile
static bool
ReadResourceLanguageFile(const TCHAR *resource)
{
if (!FindLanguage(resource))
/* refuse to load resources which are not in the language table */
return false;
LogFormat(_T("Language: loading resource '%s'"), resource);
// Load resource
ResourceLoader::Data data = ResourceLoader::Load(resource, _T("MO"));
if (data.first == NULL) {
LogFormat(_T("Language: resource '%s' not found"), resource);
return false;
}
// Load MO file from resource
delete mo_loader;
mo_loader = new MOLoader(data.first, data.second);
if (mo_loader->error()) {
LogFormat(_T("Language: could not load resource '%s'"), resource);
delete mo_loader;
mo_loader = NULL;
return false;
}
LogFormat(_T("Loaded translations from resource '%s'"), resource);
mo_file = &mo_loader->get();
return true;
}
开发者ID:MindMil,项目名称:XCSoar,代码行数:31,代码来源:LanguageGlue.cpp
示例6: LogFormat
Port::WaitResult
DumpPort::WaitRead(unsigned timeout_ms)
{
LogFormat("WaitRead %u", timeout_ms);
Port::WaitResult result = port->WaitRead(timeout_ms);
LogFormat("WaitRead %u = %d", timeout_ms, (int)result);
return result;
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:8,代码来源:DumpPort.cpp
示例7: StartupLogFreeRamAndStorage
void
StartupLogFreeRamAndStorage()
{
#ifdef HAVE_MEM_INFO
unsigned long freeram = SystemFreeRAM() / 1024;
LogFormat("Free ram %lu KB", freeram);
#endif
unsigned long freestorage = FindFreeSpace(GetPrimaryDataPath());
LogFormat("Free storage %lu KB", freestorage);
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:10,代码来源:UtilsSystem.cpp
示例8: CheckEnabled
Port::WaitResult
DumpPort::WaitRead(unsigned timeout_ms)
{
const bool enabled = CheckEnabled();
if (enabled)
LogFormat("WaitRead %u", timeout_ms);
Port::WaitResult result = port->WaitRead(timeout_ms);
if (enabled)
LogFormat("WaitRead %u = %d", timeout_ms, (int)result);
return result;
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:14,代码来源:DumpPort.cpp
示例9: devStartup
void
devStartup()
{
LogFormat("Register serial devices");
const SystemSettings &settings = CommonInterface::GetSystemSettings();
bool none_available = true;
for (unsigned i = 0; i < NUMDEV; ++i) {
DeviceDescriptor &device = *device_list[i];
const DeviceConfig &config = settings.devices[i];
if (!config.IsAvailable()) {
device.ClearConfig();
continue;
}
none_available = false;
bool overlap = false;
for (unsigned j = 0; j < i; ++j)
if (DeviceConfigOverlaps(config, device_list[j]->GetConfig()))
overlap = true;
if (overlap) {
device.ClearConfig();
continue;
}
device.SetConfig(config);
devInitOne(*device_list[i]);
}
if (none_available) {
#ifdef ANDROID
/* fall back to built-in GPS when no configured device is
available on this platform */
LogFormat("Falling back to built-in GPS");
DeviceConfig config;
config.Clear();
config.port_type = DeviceConfig::PortType::INTERNAL;
DeviceDescriptor &device = *device_list[0];
device.SetConfig(config);
devInitOne(device);
#endif
}
}
开发者ID:Tjeerdm,项目名称:XCSoarDktjm,代码行数:48,代码来源:device.cpp
示例10: ReadLanguageFile
/**
* Reads the selected LanguageFile into the cache
*/
void
ReadLanguageFile()
{
#ifndef HAVE_NATIVE_GETTEXT
CloseLanguageFile();
LogFormat("Loading language file");
TCHAR buffer[MAX_PATH], second_buffer[MAX_PATH];
const TCHAR *value = Profile::GetPath(ProfileKeys::LanguageFile, buffer)
? buffer : _T("");
if (StringIsEqual(value, _T("none")))
return;
if (StringIsEmpty(value) || StringIsEqual(value, _T("auto"))) {
AutoDetectLanguage();
return;
}
const TCHAR *base = BaseName(value);
if (base == NULL)
base = value;
if (base == value) {
LocalPath(second_buffer, value);
value = second_buffer;
}
if (!LoadLanguageFile(value) && !ReadResourceLanguageFile(base))
AutoDetectLanguage();
#endif
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:36,代码来源:LanguageGlue.cpp
示例11: LogFormat
EXPORT_C void CImMobilityLogger::LogText(TInt /*aFilePos*/, const TDesC8& /*aText*/)
#endif //__IM_MOBILITY_LOGGING
{
#ifdef __IM_MOBILITY_LOGGING
LogFormat(aFilePos, KTxtFormatText, &aText);
#endif //__IM_MOBILITY_LOGGING
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:7,代码来源:cimmobilitylogger.cpp
示例12: LocalPath
bool
WaypointGlue::SaveWaypoints(const Waypoints &way_points)
{
const auto path = LocalPath(_T("user.cup"));
TextWriter writer(path);
if (!writer.IsOpen()) {
LogFormat(_T("Waypoint file '%s' can not be written"), path.c_str());
return false;
}
WriteCup(writer, way_points, WaypointOrigin::USER);
LogFormat(_T("Waypoint file '%s' saved"), path.c_str());
return true;
}
开发者ID:MaxPower-No1,项目名称:XCSoar,代码行数:16,代码来源:SaveGlue.cpp
示例13: LogFormat
void
LoggerImpl::StopLogger(const NMEAInfo &gps_info)
{
// Logger can't be switched off if already off -> cancel
if (writer == nullptr)
return;
writer->Flush();
if (!simulator)
writer->Sign();
writer->Flush();
LogFormat(_T("Logger stopped: %s"), filename.c_str());
// Logger off
delete writer;
writer = nullptr;
// Make space for logger file, if unsuccessful -> cancel
if (gps_info.gps.real && gps_info.date_time_utc.IsDatePlausible())
IGCFileCleanup(gps_info.date_time_utc.year);
pre_takeoff_buffer.clear();
}
开发者ID:Exadios,项目名称:xcsoar-exp,代码行数:26,代码来源:LoggerImpl.cpp
示例14: LogFormat
bool
WaypointGlue::LoadWaypoints(Waypoints &way_points,
const RasterTerrain *terrain,
OperationEnvironment &operation)
{
LogFormat("ReadWaypoints");
operation.SetText(_("Loading Waypoints..."));
bool found = false;
// Delete old waypoints
way_points.Clear();
TCHAR path[MAX_PATH];
LoadWaypointFile(way_points, LocalPath(path, _T("user.cup")),
WaypointFileType::SEEYOU,
WaypointOrigin::USER, terrain, operation);
// ### FIRST FILE ###
if (Profile::GetPath(ProfileKeys::WaypointFile, path))
found |= LoadWaypointFile(way_points, path, WaypointOrigin::PRIMARY,
terrain, operation);
// ### SECOND FILE ###
if (Profile::GetPath(ProfileKeys::AdditionalWaypointFile, path))
found |= LoadWaypointFile(way_points, path, WaypointOrigin::ADDITIONAL,
terrain, operation);
// ### WATCHED WAYPOINT/THIRD FILE ###
if (Profile::GetPath(ProfileKeys::WatchedWaypointFile, path))
found |= LoadWaypointFile(way_points, path, WaypointOrigin::WATCHED,
terrain, operation);
// ### MAP/FOURTH FILE ###
// If no waypoint file found yet
if (!found) {
auto dir = OpenMapFile();
if (dir != nullptr) {
found |= LoadWaypointFile(way_points, dir, "waypoints.xcw",
WaypointFileType::WINPILOT,
WaypointOrigin::MAP,
terrain, operation);
found |= LoadWaypointFile(way_points, dir, "waypoints.cup",
WaypointFileType::SEEYOU,
WaypointOrigin::MAP,
terrain, operation);
zzip_dir_close(dir);
}
}
// Optimise the waypoint list after attaching new waypoints
way_points.Optimise();
// Return whether waypoints have been loaded into the waypoint list
return found;
}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:60,代码来源:WaypointGlue.cpp
示例15: ReadAssetNumber
void
ReadAssetNumber()
{
#ifdef _WIN32_WCE
if (ReadCompaqID()) {
LogFormat(_T("Asset ID: %s (compaq)"), asset_number);
} else if (ReadUUID()) {
LogFormat(_T("Asset ID: %s (uuid)"), asset_number);
} else {
#endif
_tcscpy(asset_number, _T("AAA"));
#ifdef _WIN32_WCE
LogFormat(_T("Asset ID: %s (fallback)"), asset_number);
}
#endif
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:16,代码来源:Asset.cpp
示例16: LogFormat
void
Profile::Load()
{
LogFormat("Loading profiles");
LoadFile(startProfileFile);
SetModified(false);
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:7,代码来源:Profile.cpp
示例17: HexDumpLine
static inline void
HexDumpLine(const char *prefix, unsigned offset,
const uint8_t *data, size_t length)
{
NarrowString<128> line;
line.clear();
for (size_t i = 0; i < length; ++i) {
if ((i & 0x7) == 0)
line += " ";
line.AppendFormat(" %02x", data[i]);
}
for (size_t i = length; i < 0x10; ++i) {
if ((i & 0x7) == 0)
line += " ";
line += " ";
}
line += " ";
for (size_t i = 0; i < length; ++i) {
if ((i & 0x7) == 0)
line += " ";
char byte[2];
byte[0] = IsPrintable(data[i]) ? (char)data[i] : '.';
byte[1] = '\0';
line += byte;
}
LogFormat("%s%04x%s", prefix, offset, line.c_str());
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:34,代码来源:HexDump.hpp
示例18: LogFormat
void
DumpPort::Flush()
{
if (CheckEnabled())
LogFormat("Flush");
port->Flush();
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:8,代码来源:DumpPort.cpp
示例19: LogFormat
void
LogCatReader::Wait(pid_t pid)
{
if (pid <= 0)
return;
int status;
pid_t pid2 = ::waitpid(pid, &status, 0);
if (pid2 <= 0)
return;
if (WIFSIGNALED(status))
LogFormat("logcat was killed by signal %d", WTERMSIG(status));
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
LogFormat("logcat has failed");
}
开发者ID:robertscottbeattie,项目名称:xcsoardev,代码行数:17,代码来源:LogCat.cpp
示例20: ParseAirspaceFile
static bool
ParseAirspaceFile(AirspaceParser &parser, Path path,
OperationEnvironment &operation)
try {
FileLineReader reader(path, Charset::AUTO);
if (!parser.Parse(reader, operation)) {
LogFormat(_T("Failed to parse airspace file: %s"), path.c_str());
return false;
}
return true;
} catch (const std::runtime_error &e) {
LogFormat(_T("Failed to parse airspace file: %s"), path.c_str());
LogError(e);
return false;
}
开发者ID:staylo,项目名称:XCSoar,代码行数:17,代码来源:AirspaceGlue.cpp
注:本文中的LogFormat函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论