Commit 342cbc9d authored by Murray Cumming's avatar Murray Cumming
Browse files

Use G_STRFUNC on all std::cerr messages.

I really need to invent some more concise way to do simple
error checks and logging.
parent cf87f7a0
......@@ -197,7 +197,7 @@ int Application::on_command_line(const Glib::RefPtr<Gio::ApplicationCommandLine>
if(!file->query_exists())
{
std::cerr << _("Glom: The file does not exist.") << std::endl;
std::cerr << "uri: " << input_uri << std::endl;
std::cerr << G_STRFUNC << ": uri: " << input_uri << std::endl;
std::cerr << std::endl << context.get_help() << std::endl;
return EXIT_FAILURE;
......
......@@ -687,7 +687,7 @@ void AppWindow::open_browsed_document(const EpcServiceInfo* server, const Glib::
}
else
{
std::cerr << "Could not parse the document that was retrieved over the network: failure_code=" << failure_code << std::endl;
std::cerr << G_STRFUNC << ": Could not parse the document that was retrieved over the network: failure_code=" << failure_code << std::endl;
}
g_free(document_contents);
......@@ -1123,7 +1123,7 @@ bool AppWindow::on_document_load()
if(!error_message.empty())
{
std::cerr << "Python Error: " << error_message << std::endl;
std::cerr << G_STRFUNC << ": Python Error: " << error_message << std::endl;
}
}
......@@ -1653,7 +1653,7 @@ bool AppWindow::recreate_database_from_example(bool& user_cancelled)
//}
//catch(const std::exception& ex)
//{
// std::cerr << "AppWindow::recreate_database_from_example(): exception: " << ex.what() << std::endl;
// std::cerr << G_STRFUNC << ": AppWindow::recreate_database_from_example(): exception: " << ex.what() << std::endl;
//HandleError(ex);
//}
......
......@@ -117,7 +117,7 @@ sharedptr<SharedConnection> Base_DB::connect_to_server(Gtk::Window* parent_windo
void Base_DB::handle_error(const Glib::Exception& ex)
{
std::cerr << "Internal Error (Base_DB::handle_error()): exception type=" << typeid(ex).name() << ", ex.what()=" << ex.what() << std::endl;
std::cerr << G_STRFUNC << ": Internal Error (Base_DB::handle_error()): exception type=" << typeid(ex).name() << ", ex.what()=" << ex.what() << std::endl;
Gtk::MessageDialog dialog(Utils::bold_message(_("Internal error")), true, Gtk::MESSAGE_WARNING );
dialog.set_secondary_text(ex.what());
......@@ -127,7 +127,7 @@ void Base_DB::handle_error(const Glib::Exception& ex)
void Base_DB::handle_error(const std::exception& ex)
{
std::cerr << "Internal Error (Base_DB::handle_error()): exception type=" << typeid(ex).name() << ", ex.what()=" << ex.what() << std::endl;
std::cerr << G_STRFUNC << ": Internal Error (Base_DB::handle_error()): exception type=" << typeid(ex).name() << ", ex.what()=" << ex.what() << std::endl;
Gtk::MessageDialog dialog(Utils::bold_message(_("Internal error")), true, Gtk::MESSAGE_WARNING );
dialog.set_secondary_text(ex.what());
......
......@@ -297,7 +297,7 @@ bool Dialog_ExistingOrNew::list_examples()
}
catch(const Glib::Exception& ex)
{
std::cerr << "Could not enumerate examples. Error=" << ex.what() << std::endl;
std::cerr << G_STRFUNC << ": Could not enumerate examples. Error=" << ex.what() << std::endl;
}
return false;
......@@ -683,7 +683,7 @@ Glib::ustring Dialog_ExistingOrNew::get_title_from_example(const std::string& re
}
catch(const Glib::Exception& exception)
{
std::cerr << "Could not enumerate files in examples directory: " << exception.what() << std::endl;
std::cerr << G_STRFUNC << ": Could not enumerate files in examples directory: " << exception.what() << std::endl;
m_current_buffer.reset();
}
......@@ -726,7 +726,7 @@ void Dialog_ExistingOrNew::append_example(const Glib::ustring& title, const std:
}
catch(const Glib::Exception& ex)
{
std::cerr << "Could not read example: " << resource_name << ": " << ex.what() << std::endl;
std::cerr << G_STRFUNC << ": Could not read example: " << resource_name << ": " << ex.what() << std::endl;
}
}
#endif /* !GLOM_ENABLE_CLIENT_ONLY */
......
......@@ -77,7 +77,7 @@ void FileChooser_Export::set_export_layout(const Document::type_list_layout_grou
m_table_name = table_name;
m_document = document;
if(!m_document)
std::cerr << "FileChooser_Export::set_export_layout() document is NULL." << std::endl;
std::cerr << G_STRFUNC << ": FileChooser_Export::set_export_layout() document is NULL." << std::endl;
}
//We only allow a full export in client-only mode,
......
......@@ -706,7 +706,7 @@ void Frame_Glom::export_data_to_stream(std::ostream& the_stream, const FoundSet&
size_t pos = field_text.find_first_of(newline_to_find);
if(pos != std::string::npos)
{
std::cerr << "export: binary data field text contains an unexpected newline: " << field_text << std::endl;
std::cerr << G_STRFUNC << ": export: binary data field text contains an unexpected newline: " << field_text << std::endl;
continue;
}
......@@ -714,7 +714,7 @@ void Frame_Glom::export_data_to_stream(std::ostream& the_stream, const FoundSet&
pos = field_text.find_first_of(quote_to_find);
if(pos != std::string::npos)
{
std::cerr << "export: binary data field text contains an unexpected quote: " << field_text << std::endl;
std::cerr << G_STRFUNC << ": export: binary data field text contains an unexpected quote: " << field_text << std::endl;
continue;
}
}
......
......@@ -129,19 +129,19 @@ void get_glade_widget_with_warning(const std::string& filename, const Glib::ustr
}
catch(const Gtk::BuilderError& ex)
{
std::cerr << ex.what() << std::endl;
std::cerr << G_STRFUNC << ": " << ex.what() << std::endl;
}
catch(const Glib::MarkupError& ex)
{
std::cerr << ex.what() << std::endl;
std::cerr << G_STRFUNC << ": " << ex.what() << std::endl;
}
catch(const Glib::FileError& ex)
{
std::cerr << ex.what() << std::endl;
std::cerr << G_STRFUNC << ": " << ex.what() << std::endl;
}
catch(const Gio::ResourceError& ex)
{
std::cerr << ex.what() << std::endl;
std::cerr << G_STRFUNC << ": " << ex.what() << std::endl;
}
if(refXml)
......
......@@ -240,7 +240,7 @@ int main(int argc, char* argv[])
//https://bugzilla.gnome.org/show_bug.cgi?id=619445
//This should tell us what the problem is:
std::cerr << G_STRFUNC << ": exception from std::locale::global(std::locale(\"\")): " << ex.what() << std::endl;
std::cerr << " This can happen if the locale is not properly installed or configured." << std::endl;
std::cerr << G_STRFUNC << ": This can happen if the locale is not properly installed or configured." << std::endl;
}
......@@ -292,7 +292,7 @@ int main(int argc, char* argv[])
if(!file->query_exists())
{
std::cerr << _("Glom: The file does not exist.") << std::endl;
std::cerr << "uri: " << input_uri << std::endl;
std::cerr << G_STRFUNC << ": uri: " << input_uri << std::endl;
std::cerr << std::endl << context.get_help() << std::endl;
return EXIT_FAILURE;
......@@ -312,7 +312,7 @@ int main(int argc, char* argv[])
if(input_uri.empty())
{
std::cerr << "Please specify a glom example file." << std::endl;
std::cerr << G_STRFUNC << ": Please specify a glom example file." << std::endl;
std::cerr << std::endl << context.get_help() << std::endl;
return EXIT_FAILURE;
}
......@@ -321,7 +321,7 @@ int main(int argc, char* argv[])
//Check the output directory path:
if(group.m_arg_filepath_dir_output.empty())
{
std::cerr << "Please specify an output directory path." << std::endl;
std::cerr << G_STRFUNC << ": Please specify an output directory path." << std::endl;
std::cerr << std::endl << context.get_help() << std::endl;
return EXIT_FAILURE;
}
......@@ -333,7 +333,7 @@ int main(int argc, char* argv[])
if(!file->query_exists())
{
std::cerr << _("Glom: The output directory does not exist.") << std::endl;
std::cerr << "uri: " << group.m_arg_filepath_dir_output << std::endl;
std::cerr << G_STRFUNC << ": uri: " << group.m_arg_filepath_dir_output << std::endl;
std::cerr << std::endl << context.get_help() << std::endl;
return EXIT_FAILURE;
......@@ -351,7 +351,7 @@ int main(int argc, char* argv[])
//Check the output name path:
if(group.m_arg_filepath_name_output.empty())
{
std::cerr << "Please specify an output name." << std::endl;
std::cerr << G_STRFUNC << ": Please specify an output name." << std::endl;
std::cerr << std::endl << context.get_help() << std::endl;
return EXIT_FAILURE;
}
......@@ -366,7 +366,7 @@ int main(int argc, char* argv[])
if(!test)
{
std::cerr << "Document::load() failed with failure_code=" << failure_code << std::endl;
std::cerr << G_STRFUNC << ": Document::load() failed with failure_code=" << failure_code << std::endl;
return EXIT_FAILURE;
}
......@@ -392,7 +392,7 @@ int main(int argc, char* argv[])
Glib::RefPtr<Gio::File> file = Gio::File::create_for_commandline_arg(uri);
if(file->query_exists())
{
std::cerr << "The output path already exists: " << filepath_dir << std::endl;
std::cerr << G_STRFUNC << ": The output path already exists: " << filepath_dir << std::endl;
return EXIT_FAILURE;
}
}
......@@ -459,7 +459,7 @@ int main(int argc, char* argv[])
#ifdef G_OS_WIN32
const char* password = "";
std::cerr << "Error: getpass() is not implemented in the Windows build. The connection will fail." << std::endl;
std::cerr << G_STRFUNC << ": Error: getpass() is not implemented in the Windows build. The connection will fail." << std::endl;
#else
const char* password = ::getpass(prompt.c_str());
#endif
......@@ -506,7 +506,7 @@ int main(int argc, char* argv[])
const Glom::ConnectionPool::StartupErrors started = connection_pool->startup( sigc::ptr_fun(&on_startup_progress) );
if(started != Glom::ConnectionPool::Backend::STARTUPERROR_NONE)
{
std::cerr << "connection_pool->startup(): result=" << started << std::endl;
std::cerr << G_STRFUNC << ": connection_pool->startup(): result=" << started << std::endl;
cleanup();
}
g_assert(started == Glom::ConnectionPool::Backend::STARTUPERROR_NONE);
......
......@@ -93,7 +93,7 @@ int main(int argc, char* argv[])
//https://bugzilla.gnome.org/show_bug.cgi?id=619445
//This should tell us what the problem is:
std::cerr << G_STRFUNC << ": exception from std::locale::global(std::locale(\"\")): " << ex.what() << std::endl;
std::cerr << " This can happen if the locale is not properly installed or configured." << std::endl;
std::cerr << G_STRFUNC << ": This can happen if the locale is not properly installed or configured." << std::endl;
}
......@@ -160,7 +160,7 @@ int main(int argc, char* argv[])
if(!file_input->query_exists())
{
std::cerr << _("Glom: The file does not exist.") << std::endl;
std::cerr << "uri: " << input_uri << std::endl;
std::cerr << G_STRFUNC << ": uri: " << input_uri << std::endl;
std::cerr << std::endl << context.get_help() << std::endl;
return EXIT_FAILURE;
......@@ -190,7 +190,7 @@ int main(int argc, char* argv[])
if(file_output->query_exists())
{
std::cerr << _("Glom: The output file aready exists.") << std::endl;
std::cerr << "uri: " << ouput_uri << std::endl;
std::cerr << G_STRFUNC << ": uri: " << ouput_uri << std::endl;
std::cerr << std::endl << context.get_help() << std::endl;
return EXIT_FAILURE;
......@@ -207,7 +207,7 @@ int main(int argc, char* argv[])
if(!test)
{
std::cerr << "Document::load() failed with failure_code=" << failure_code << std::endl;
std::cerr << G_STRFUNC << ": Document::load() failed with failure_code=" << failure_code << std::endl;
return EXIT_FAILURE;
}
......
......@@ -81,7 +81,7 @@ int main(int argc, char* argv[])
//https://bugzilla.gnome.org/show_bug.cgi?id=619445
//This should tell us what the problem is:
std::cerr << G_STRFUNC << ": exception from std::locale::global(std::locale(\"\")): " << ex.what() << std::endl;
std::cerr << " This can happen if the locale is not properly installed or configured." << std::endl;
std::cerr << G_STRFUNC << ": This can happen if the locale is not properly installed or configured." << std::endl;
}
......@@ -141,7 +141,7 @@ int main(int argc, char* argv[])
if(!file_input->query_exists())
{
std::cerr << _("The Glom file does not exist.") << std::endl;
std::cerr << "uri: " << input_uri << std::endl;
std::cerr << G_STRFUNC << ": uri: " << input_uri << std::endl;
std::cerr << std::endl << context.get_help() << std::endl;
return EXIT_FAILURE;
......@@ -194,7 +194,7 @@ int main(int argc, char* argv[])
if(!test)
{
std::cerr << "Document::load() failed with failure_code=" << failure_code << std::endl;
std::cerr << G_STRFUNC << ": Document::load() failed with failure_code=" << failure_code << std::endl;
return EXIT_FAILURE;
}
......
......@@ -82,7 +82,7 @@ int main(int argc, char* argv[])
//https://bugzilla.gnome.org/show_bug.cgi?id=619445
//This should tell us what the problem is:
std::cerr << G_STRFUNC << ": exception from std::locale::global(std::locale(\"\")): " << ex.what() << std::endl;
std::cerr << " This can happen if the locale is not properly installed or configured." << std::endl;
std::cerr << G_STRFUNC << ": This can happen if the locale is not properly installed or configured." << std::endl;
}
......@@ -142,7 +142,7 @@ int main(int argc, char* argv[])
if(!file_input->query_exists())
{
std::cerr << _("The Glom file does not exist.") << std::endl;
std::cerr << "uri: " << input_uri << std::endl;
std::cerr << G_STRFUNC << ": uri: " << input_uri << std::endl;
std::cerr << std::endl << context.get_help() << std::endl;
return EXIT_FAILURE;
......@@ -185,7 +185,7 @@ int main(int argc, char* argv[])
if(!test)
{
std::cerr << "Document::load() failed with failure_code=" << failure_code << std::endl;
std::cerr << G_STRFUNC << ": Document::load() failed with failure_code=" << failure_code << std::endl;
return EXIT_FAILURE;
}
......
......@@ -129,7 +129,7 @@ int main(int argc, char* argv[])
//https://bugzilla.gnome.org/show_bug.cgi?id=619445
//This should tell us what the problem is:
std::cerr << G_STRFUNC << ": exception from std::locale::global(std::locale(\"\")): " << ex.what() << std::endl;
std::cerr << " This can happen if the locale is not properly installed or configured." << std::endl;
std::cerr << G_STRFUNC << ": This can happen if the locale is not properly installed or configured." << std::endl;
}
......@@ -151,7 +151,7 @@ int main(int argc, char* argv[])
}
catch(const Glib::Error& ex)
{
std::cerr << "Error: " << ex.what() << std::endl;
std::cerr << G_STRFUNC << ": Error: " << ex.what() << std::endl;
return EXIT_FAILURE;
}
......@@ -163,7 +163,7 @@ int main(int argc, char* argv[])
if(group.m_arg_server_hostname.empty())
{
std::cerr << "Please provide a database hostname." << std::endl;
std::cerr << G_STRFUNC << ": Please provide a database hostname." << std::endl;
print_options_hint();
return EXIT_FAILURE;
}
......@@ -184,7 +184,7 @@ int main(int argc, char* argv[])
#ifdef G_OS_WIN32
const char* password = "";
std::cerr << "Error: getpass() is not implemented in the Windows build. The connection will fail." << std::endl;
std::cerr << G_STRFUNC << ": Error: getpass() is not implemented in the Windows build. The connection will fail." << std::endl;
#else
const char* password = ::getpass(prompt.c_str());
#endif
......
......@@ -570,7 +570,7 @@ void CsvParser::on_file_query_info(const Glib::RefPtr<Gio::AsyncResult>& result,
}
catch(const Glib::Exception& ex)
{
std::cerr << "Failed to fetch display name of uri " << source->get_uri() << ": " << ex.what() << std::endl;
std::cerr << G_STRFUNC << "Failed to fetch display name of uri " << source->get_uri() << ": " << ex.what() << std::endl;
}
}
......
......@@ -733,7 +733,7 @@ void Dialog_Import_CSV::on_parser_file_read_error(const Glib::ustring& error_mes
}
catch(const Glib::ConvertError& ex)
{
std::cerr << "Glib::filename_from_uri() failed: " << ex.what() << std::endl;
std::cerr << G_STRFUNC << "Glib::filename_from_uri() failed: " << ex.what() << std::endl;
show_error_dialog(_("Could Not Open file"),
Glib::ustring::compose(_("The file at \"%1\" could not be opened: %2"), filename, error_message) );
......
......@@ -79,7 +79,7 @@ void Dialog_Import_CSV_Progress::import(Dialog_Import_CSV& data_source)
}
catch(const Glib::ConvertError& ex)
{
std::cerr << "Glib::filename_from_uri() failed: " << ex.what() << std::endl;
std::cerr << G_STRFUNC << ": Glib::filename_from_uri() failed: " << ex.what() << std::endl;
}
m_progress_bar->set_text(Glib::ustring::compose(_("Parsing CSV file %1"), filename));
......
......@@ -484,7 +484,7 @@ bool ConnectionPool::convert_backup(const SlotProgress& slot_progress, const std
//and a warning will only be useful later when get_meta_store_data() fails when used in get_table_names_from_database().
if(!m_fake_connection)
{
std::cerr << "ConnectionPool::connect(): update_meta_store_table_names() failed: " << ex.what() << std::endl;
std::cerr << G_STRFUNC << ": ConnectionPool::connect(): update_meta_store_table_names() failed: " << ex.what() << std::endl;
}
}
......
......@@ -144,7 +144,7 @@ Glib::RefPtr<Gnome::Gda::Connection> MySQL::attempt_connect(const Glib::ustring&
if(temp_conn)
std::cout << " (Connection succeeds, but not to the specific database, database=" << database << std::endl;
else
std::cerr << " (Could not connect even to the default database, database=" << database << std::endl;
std::cerr << G_STRFUNC << ": (Could not connect even to the default database, database=" << database << std::endl;
#endif
throw ExceptionConnection(temp_conn ? ExceptionConnection::FAILURE_NO_DATABASE : ExceptionConnection::FAILURE_NO_SERVER);
......@@ -389,7 +389,7 @@ bool MySQL::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connectio
catch(const Glib::Error& ex)
{
std::cerr << G_STRFUNC << "Exception: " << ex.what() << std::endl;
std::cerr << " Reverting the transaction." << std::endl;
std::cerr << G_STRFUNC << ": Reverting the transaction." << std::endl;
try
{
......@@ -589,7 +589,7 @@ bool MySQL::save_backup(const SlotProgress& slot_progress, const Glib::ustring&
if(!result)
{
std::cerr << "Error while attempting to call pg_dump." << std::endl;
std::cerr << G_STRFUNC << ": Error while attempting to call pg_dump." << std::endl;
}
return result;
......@@ -650,7 +650,7 @@ bool MySQL::convert_backup(const SlotProgress& slot_progress, const std::string&
if(!result)
{
std::cerr << "Error while attempting to call pg_restore." << std::endl;
std::cerr << G_STRFUNC << ": Error while attempting to call pg_restore." << std::endl;
}
return result;
......@@ -808,7 +808,7 @@ bool MySQL::create_text_file(const std::string& file_uri, const std::string& con
const Gio::Error& ex = *error.get();
#endif
// If the operation was not successful, print the error and abort
std::cerr << "ConnectionPool::create_text_file(): exception while creating file." << std::endl
std::cerr << G_STRFUNC << ": ConnectionPool::create_text_file(): exception while creating file." << std::endl
<< " file uri:" << file_uri << std::endl
<< " error:" << ex.what() << std::endl;
return false; // print_error(ex, output_uri_string);
......@@ -836,7 +836,7 @@ bool MySQL::create_text_file(const std::string& file_uri, const std::string& con
Gio::Error& ex = *error.get();
#endif
// If the operation was not successful, print the error and abort
std::cerr << "ConnectionPool::create_text_file(): exception while writing to file." << std::endl
std::cerr << G_STRFUNC << ": ConnectionPool::create_text_file(): exception while writing to file." << std::endl
<< " file uri:" << file_uri << std::endl
<< " error:" << ex.what() << std::endl;
return false; //print_error(ex, output_uri_string);
......@@ -844,7 +844,7 @@ bool MySQL::create_text_file(const std::string& file_uri, const std::string& con
if(bytes_written != (gssize)contents_size)
{
std::cerr << "ConnectionPool::create_text_file(): not all bytes written when writing to file." << std::endl
std::cerr << G_STRFUNC << ": ConnectionPool::create_text_file(): not all bytes written when writing to file." << std::endl
<< " file uri:" << file_uri << std::endl;
return false;
}
......
......@@ -136,7 +136,7 @@ Backend::InitErrors MySQLSelfHosted::initialize(const SlotProgress& slot_progres
if(initial_username.empty())
{
std::cerr << "MySQLSelfHosted::initialize(). Username was empty while attempting to create self-hosting database" << std::endl;
std::cerr << G_STRFUNC << ": MySQLSelfHosted::initialize(). Username was empty while attempting to create self-hosting database" << std::endl;
return INITERROR_OTHER;
}
......@@ -154,7 +154,7 @@ Backend::InitErrors MySQLSelfHosted::initialize(const SlotProgress& slot_progres
const bool dbdir_created = create_directory_filepath(dbdir);
if(!dbdir_created)
{
std::cerr << "Couldn't create directory: " << dbdir << std::endl;
std::cerr << G_STRFUNC << ": Couldn't create directory: " << dbdir << std::endl;
return INITERROR_COULD_NOT_CREATE_DIRECTORY;
}
......@@ -166,7 +166,7 @@ Backend::InitErrors MySQLSelfHosted::initialize(const SlotProgress& slot_progres
const std::string dbdir_data = get_self_hosting_data_path(true /* create */);
if(dbdir_data.empty())
{
std::cerr << "Couldn't create the data directory: " << dbdir << std::endl;
std::cerr << G_STRFUNC << ": Couldn't create the data directory: " << dbdir << std::endl;
return INITERROR_COULD_NOT_CREATE_DIRECTORY;
}
......@@ -189,7 +189,7 @@ Backend::InitErrors MySQLSelfHosted::initialize(const SlotProgress& slot_progres
const bool result = Glom::Spawn::execute_command_line_and_wait(command_initdb, slot_progress);
if(!result)
{
std::cerr << "Error while attempting to create self-hosting MySQL database." << std::endl;
std::cerr << G_STRFUNC << ": Error while attempting to create self-hosting MySQL database." << std::endl;
}
else
{
......@@ -211,14 +211,14 @@ Backend::InitErrors MySQLSelfHosted::initialize(const SlotProgress& slot_progres
//and we cannot take the risk of leaving the database with a default password.
if(startup(slot_progress, false) != STARTUPERROR_NONE)
{
std::cerr << "Error while attempting to create self-hosting MySQL database, while starting for the first time, to set the initial username and password." << std::endl;
std::cerr << G_STRFUNC << ": Error while attempting to create self-hosting MySQL database, while starting for the first time, to set the initial username and password." << std::endl;
return INITERROR_OTHER;
}
else
{
if(!cleanup(slot_progress))
{
std::cerr << "Error while attempting to create self-hosting MySQL database, while shutting down, after setting the initial username and password." << std::endl;
std::cerr << G_STRFUNC << ": Error while attempting to create self-hosting MySQL database, while shutting down, after setting the initial username and password." << std::endl;
return INITERROR_OTHER;
}
}
......@@ -395,7 +395,7 @@ Backend::StartupErrors MySQLSelfHosted::startup(const SlotProgress& slot_progres
if(!result)
{
std::cerr << "Error while attempting to start self-hosting MySQL database, when setting the initial password." << std::endl;
std::cerr << G_STRFUNC << ": Error while attempting to start self-hosting MySQL database, when setting the initial password." << std::endl;
return STARTUPERROR_FAILED_UNKNOWN_REASON;
}
......@@ -539,7 +539,7 @@ bool MySQLSelfHosted::cleanup(const SlotProgress& slot_progress)
if(!result)
{
std::cerr << "Error while attempting to stop self-hosting of the MySQL database. Trying again." << std::endl;
std::cerr << G_STRFUNC << ": Error while attempting to stop self-hosting of the MySQL database. Trying again." << std::endl;
//Show open connections for debugging:
try
......@@ -556,7 +556,7 @@ bool MySQLSelfHosted::cleanup(const SlotProgress& slot_progress)
const bool result = Glom::Spawn::execute_command_line_and_wait(command_mysql_stop, slot_progress);
if(!result)
{
std::cerr << "Error while attempting (for a second time) to stop self-hosting of the database." << std::endl;
std::cerr << G_STRFUNC << ": Error while attempting (for a second time) to stop self-hosting of the database." << std::endl;
return false;
}
}
......@@ -667,7 +667,7 @@ unsigned int MySQLSelfHosted::discover_first_free_port(unsigned int start_port,
if(fd == -1)
{
#ifdef G_OS_WIN32
std::cerr << "Create socket: " << WSAGetLastError() << std::endl;
std::cerr << G_STRFUNC << ": Create socket: " << WSAGetLastError() << std::endl;
#else
perror("Create socket");
#endif //G_OS_WIN32
......
......@@ -131,7 +131,7 @@ Glib::RefPtr<Gnome::Gda::Connection> Postgres::attempt_connect(const Glib::ustri
if(temp_conn)
std::cout << " (Connection succeeds, but not to the specific database, database=" << database << std::endl;
else
std::cerr << " (Could not connect even to the default database, database=" << database << std::endl;
std::cerr << G_STRFUNC << ": (Could not connect even to the default database, database=" << database << std::endl;
#endif
throw ExceptionConnection(temp_conn ? ExceptionConnection::FAILURE_NO_DATABASE : ExceptionConnection::FAILURE_NO_SERVER);
......@@ -373,8 +373,8 @@ bool Postgres::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connec
}
catch(const Glib::Error& ex)
{
std::cerr << "Exception: " << ex.what() << std::endl;
std::cerr << "Reverting the transaction." << std::endl;
std::cerr << G_STRFUNC << ": Exception: " << ex.what() << std::endl;
std::cerr << G_STRFUNC << ": Reverting the transaction." << std::endl;
try
{
......@@ -382,7 +382,7 @@ bool Postgres::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connec
}
catch(const Glib::Error& ex)
{
std::cerr << "Could not rollback the transaction: Exception: " << ex.what() << std::endl;
std::cerr << G_STRFUNC << ": Could not rollback the transaction: Exception: " << ex.what() << std::endl;
}
}
......@@ -654,7 +654,7 @@ bool Postgres::save_backup(const SlotProgress& slot_progress, const Glib::ustrin
if(!result)
{
std::cerr << "Error while attempting to call pg_dump." << std::endl;
std::cerr << G_STRFUNC << ": Error while attempting to call pg_dump." << std::endl;
}
return result;
......@@ -738,7 +738,7 @@ bool Postgres::convert_backup(const SlotProgress& slot_progress, const std::stri
if(!result)
{
std::cerr << "Error while attempting to call pg_restore." << std::endl;
std::cerr << G_STRFUNC << ": Error while attempting to call pg_restore." << std::endl;
}
return result;
......@@ -896,7 +896,7 @@ bool Postgres::create_text_file(const std::string& file_uri, const std::string&
const Gio::Error& ex = *error.get();
#endif
// If the operation was not successful, print the error and abort
std::cerr << "ConnectionPool::create_text_file(): exception while creating file." << std::endl
std::cerr << G_STRFUNC << ": ConnectionPool::create_text_file(): exception while creating file." << std::endl