diff options
author | Yaniv Kamay <ykamay@redhat.com> | 2010-01-11 19:30:39 +0200 |
---|---|---|
committer | Yaniv Kamay <ykamay@redhat.com> | 2010-01-11 19:30:39 +0200 |
commit | ad121810278c1e2851f74c370e1cb36e52367be3 (patch) | |
tree | e6cf3525bcf2b1161bbe5177d9c60f90183736a4 /client/application.cpp | |
parent | 3eae1c80d97ce6d1e0eee69f7454973abdb94ef6 (diff) | |
download | spice-ad121810278c1e2851f74c370e1cb36e52367be3.tar.gz spice-ad121810278c1e2851f74c370e1cb36e52367be3.tar.xz spice-ad121810278c1e2851f74c370e1cb36e52367be3.zip |
client: move log file to spicec appdata dir
Diffstat (limited to 'client/application.cpp')
-rw-r--r-- | client/application.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/client/application.cpp b/client/application.cpp index d4fe59f6..a0e34360 100644 --- a/client/application.cpp +++ b/client/application.cpp @@ -57,6 +57,8 @@ mutex_t cairo_surface_user_data_mutex; #endif +static const char* app_name = "spicec"; + void ConnectedEvent::response(AbstractProcessLoop& events_loop) { static_cast<Application*>(events_loop.get_owner())->on_connected(); @@ -1822,8 +1824,8 @@ bool Application::process_cmd_line(int argc, char** argv) _host_auth_opt.type_flags = RedPeer::HostAuthOptions::HOST_AUTH_OP_NAME; - Platform::get_spice_config_dir(_host_auth_opt.CA_file); - _host_auth_opt.CA_file += CA_FILE_NAME; + Platform::get_app_data_dir(_host_auth_opt.CA_file, app_name); + Platform::path_append(_host_auth_opt.CA_file, CA_FILE_NAME); parser.begin(argc, argv); @@ -1954,15 +1956,17 @@ bool Application::process_cmd_line(int argc, char** argv) void Application::init_logger() { - std::string temp_dir_name; - Platform::get_temp_dir(temp_dir_name); - std::string log_file_name = temp_dir_name + "spicec.log"; + std::string log_file_name; + Platform::get_app_data_dir(log_file_name, app_name); + Platform::path_append(log_file_name, "spicec.log"); int fd = ::open(log_file_name.c_str(), O_CREAT | O_APPEND | O_WRONLY, 0644); + if (fd == -1) { log4cpp::BasicConfigurator::configure(); return; } + log4cpp::Category& root = log4cpp::Category::getRoot(); #ifdef RED_DEBUG root.setPriority(log4cpp::Priority::DEBUG); |