diff options
author | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-08-16 03:59:01 +0000 |
---|---|---|
committer | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-08-16 03:59:01 +0000 |
commit | 97f7263c8ffbe02c710353e07080be1c52d692db (patch) | |
tree | 616f19b884a0616eef38ca7f3080a136fbb8349e /ace/Logging_Strategy.cpp | |
parent | 2b48b9367e6005bf698fcd025d6e9bca14f1d3c4 (diff) | |
download | ATCD-97f7263c8ffbe02c710353e07080be1c52d692db.tar.gz |
ChangeLogTag:Tue Aug 15 20:54:14 2000 Darrell Brunsch <brunsch@uci.edu>
Diffstat (limited to 'ace/Logging_Strategy.cpp')
-rw-r--r-- | ace/Logging_Strategy.cpp | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/ace/Logging_Strategy.cpp b/ace/Logging_Strategy.cpp index 20df7a1cfea..be72da3cce7 100644 --- a/ace/Logging_Strategy.cpp +++ b/ace/Logging_Strategy.cpp @@ -12,39 +12,39 @@ ACE_RCSID(lib, Logging_Strategy, "$Id$") // accordingly. void -ACE_Logging_Strategy::tokenize (char *flag_string) +ACE_Logging_Strategy::tokenize (ACE_TCHAR *flag_string) { - for (char *flag = ACE_OS::strtok (flag_string, "|"); + for (ACE_TCHAR *flag = ACE_OS::strtok (flag_string, ACE_TEXT("|")); flag != 0; - flag = ACE_OS::strtok (0, "|")) + flag = ACE_OS::strtok (0, ACE_TEXT("|"))) { - if (ACE_OS::strcmp (flag, "STDERR") == 0) + if (ACE_OS::strcmp (flag, ACE_TEXT("STDERR")) == 0) ACE_SET_BITS (this->flags_, ACE_Log_Msg::STDERR); - else if (ACE_OS::strcmp (flag, "LOGGER") == 0) + else if (ACE_OS::strcmp (flag, ACE_TEXT("LOGGER")) == 0) ACE_SET_BITS (this->flags_, ACE_Log_Msg::LOGGER); - else if (ACE_OS::strcmp (flag, "OSTREAM") == 0) + else if (ACE_OS::strcmp (flag, ACE_TEXT("OSTREAM")) == 0) ACE_SET_BITS (this->flags_, ACE_Log_Msg::OSTREAM); - else if (ACE_OS::strcmp (flag, "VERBOSE") == 0) + else if (ACE_OS::strcmp (flag, ACE_TEXT("VERBOSE")) == 0) ACE_SET_BITS (this->flags_, ACE_Log_Msg::VERBOSE); - else if (ACE_OS::strcmp (flag, "VERBOSE_LITE") == 0) + else if (ACE_OS::strcmp (flag, ACE_TEXT("VERBOSE_LITE")) == 0) ACE_SET_BITS (this->flags_, ACE_Log_Msg::VERBOSE_LITE); - else if (ACE_OS::strcmp (flag, "SILENT") == 0) + else if (ACE_OS::strcmp (flag, ACE_TEXT("SILENT")) == 0) ACE_SET_BITS (this->flags_, ACE_Log_Msg::SILENT); } } int -ACE_Logging_Strategy::parse_args (int argc, char *argv[]) +ACE_Logging_Strategy::parse_args (int argc, ACE_TCHAR *argv[]) { ACE_TRACE ("ACE_Logging_Strategy::parse_args"); - char *temp; + ACE_TCHAR *temp; this->flags_ = 0; this->wipeout_logfile_ = 0; this->interval_ = 0; this->max_size_ = ACE_DEFAULT_MAX_LOGFILE_SIZE; - ACE_Get_Opt get_opt (argc, argv, "f:i:m:s:w", 0); + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("f:i:m:s:w"), 0); for (int c; (c = get_opt ()) != -1; ) { @@ -89,20 +89,21 @@ ACE_Logging_Strategy::ACE_Logging_Strategy (void) #if defined (ACE_DEFAULT_LOGFILE) this->filename_ = ACE::strnew (ACE_DEFAULT_LOGFILE); #else /* ACE_DEFAULT_LOGFILE */ - ACE_NEW (this->filename_, char[MAXPATHLEN + 1]); + ACE_NEW (this->filename_, ACE_TCHAR[MAXPATHLEN + 1]); // Get the temporary directory if (ACE::get_temp_dir (this->filename_, MAXPATHLEN - 7) == -1) // 7 for "logfile" { ACE_ERROR ((LM_ERROR, - "Temporary path too long, defaulting to current directory\n")); + ACE_TEXT("Temporary path too long, ") + ACE_TEXT("defaulting to current directory\n"))); this->filename_[0] = 0; } // Add the filename to the end ACE_OS::strcat (this->filename_, - "logfile"); + ACE_TEXT("logfile")); #endif /* ACE_DEFAULT_LOGFILE */ } @@ -114,7 +115,7 @@ ACE_Logging_Strategy::fini (void) } int -ACE_Logging_Strategy::init (int argc, char *argv[]) +ACE_Logging_Strategy::init (int argc, ACE_TCHAR *argv[]) { ACE_TRACE ("ACE_Logging_Strategy::init"); @@ -140,11 +141,11 @@ ACE_Logging_Strategy::init (int argc, char *argv[]) // Create a new ofstream to direct output to the file. if (wipeout_logfile_) ACE_NEW_RETURN (output_file, - ofstream (this->filename_), + ofstream (ACE_TEXT_ALWAYS_CHAR(this->filename_)), -1); else ACE_NEW_RETURN (output_file, - ofstream (this->filename_, + ofstream (ACE_TEXT_ALWAYS_CHAR(this->filename_), ios::app | ios::out), -1); @@ -167,9 +168,9 @@ ACE_Logging_Strategy::init (int argc, char *argv[]) ACE_Log_Msg::instance ()->set_flags (this->flags_); } - return ACE_LOG_MSG->open ("Logging_Strategy", + return ACE_LOG_MSG->open (ACE_TEXT("Logging_Strategy"), ACE_LOG_MSG->flags (), - ACE_TEXT_CHAR_TO_TCHAR (ACE_DEFAULT_LOGGER_KEY)); + ACE_DEFAULT_LOGGER_KEY); } int @@ -192,10 +193,10 @@ ACE_Logging_Strategy::handle_timeout (const ACE_Time_Value &, // Save current logfile to logfile.old if (ACE_OS::strlen (this->filename_) + 4 <= MAXPATHLEN) // 4 for ".old" { - char backup[MAXPATHLEN+1]; + ACE_TCHAR backup[MAXPATHLEN+1]; ACE_OS::strcpy (backup, this->filename_); - ACE_OS::strcat (backup, ".old"); + ACE_OS::strcat (backup, ACE_TEXT(".old")); // Remove any existing .old file; ignore error as file may // not exist. @@ -211,7 +212,7 @@ ACE_Logging_Strategy::handle_timeout (const ACE_Time_Value &, ACE_TEXT ("Backup file name too long; backup logfile not saved.\n"))); // Open a new log file by the same name - output_file->open (this->filename_, ios::out); + output_file->open (ACE_TEXT_ALWAYS_CHAR(this->filename_), ios::out); // Release the lock previously acquired. ACE_LOG_MSG->release (); |