Exemplo n.º 1
0
bool EViacamApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
	bool debug_mode= parser.Found(wxT("d"));
#ifndef NDEBUG
	debug_mode = true;
#endif

	if (debug_mode) {
		// Set log priority level
		slog_set_priority (SLOG_PRIO_DEBUG);

#if defined(WIN32)
		AllocConsole();
		freopen("CONOUT$", "wb", stdout);
		freopen("CONOUT$", "wb", stderr);
		slog_write (SLOG_PRIO_INFO, "debug mode enabled");
#endif
	}	

	wxString custom_config_path;
	bool custom_config= parser.Found(wxT("c"), &custom_config_path);
	if (custom_config) {
		wxFileConfig* customFileConfig = new wxFileConfig(wxEmptyString, wxEmptyString,
                                                          custom_config_path, custom_config_path,
                                                          wxCONFIG_USE_LOCAL_FILE);
		wxConfigBase::Set(customFileConfig);
	}

	return true;
}
Exemplo n.º 2
0
bool EViacamApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
	bool debug_mode= parser.Found(wxT("d"));

	if (debug_mode) {
		// Set log priority level
		slog_set_priority (SLOG_PRIO_DEBUG);

#if defined(WIN32)
		AllocConsole();
		freopen("CONOUT$", "wb", stdout);
		freopen("CONOUT$", "wb", stderr);
		slog_write (SLOG_PRIO_INFO, "debug mode enabled");
#endif
	}	

	return true;
}