summaryrefslogtreecommitdiff
path: root/TAO/DevGuideExamples/SmartProxies/Logger_i.cpp
blob: 077bd43a8b27433a884358382c5cb1e971348c9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "Logger_i.h"
#include "ace/OS_NS_time.h"
#include <iostream>

Logger_i::Logger_i (void)
{
  log_file.open("Logger.txt");
}

Logger_i::~Logger_i (void)
{
  log_file.close();
}

CORBA::Boolean Logger_i::log_message (const char * message)
{
  ACE_OS::time(&log_time);
  log_time_string = ACE_OS::ctime(&log_time);
  // Replace carriage return with string delimiter.
  log_time_string[24] = '\0';
  log_file << ACE_TEXT_ALWAYS_CHAR(log_time_string.c_str()) << " "
           << message << std::endl;
  return true;
}