Public Member Functions | Static Public Member Functions | Static Public Attributes

ACE::INet_Log Class Reference

#include <INet_Log.h>

List of all members.

Public Member Functions

 INet_Log ()

Static Public Member Functions

static unsigned int Initializer (void)

Static Public Attributes

static unsigned int debug_level_ = INet_Log::Initializer ()

Detailed Description

Definition at line 22 of file INet_Log.h.


Constructor & Destructor Documentation

ACE::INet_Log::INet_Log (  )  [inline]

Definition at line 25 of file INet_Log.h.

{}


Member Function Documentation

unsigned int ACE::INet_Log::Initializer ( void   )  [static]

Definition at line 11 of file INet_Log.cpp.

  {
    unsigned int INet_Log::debug_level_ = INet_Log::Initializer ();

    unsigned int INet_Log::Initializer(void)
      {
        unsigned int debug_level = 0;
        bool trace = false;
        ACE_TString filename;

        ACE_Env_Value<int> log (ACE_TEXT("INET_LOG_LEVEL"), debug_level);
        debug_level = log;

        ACE_Env_Value<int> trace_env (ACE_TEXT("INET_TRACE_ENABLE"), 0);
        trace = (trace_env != 0);

        ACE_Env_Value<const ACE_TCHAR *> filename_env (ACE_TEXT("INET_LOG_FILE"), filename.c_str ());
        filename = filename_env;

        if (trace)
          {
            INET_ENABLE_TRACE ();
          }
        else
          {
            INET_DISABLE_TRACE ();
          }

        if (filename.length () > 0)
          {
#if defined (ACE_LACKS_IOSTREAM_TOTALLY)

            FILE* output_stream = ACE_OS::fopen (filename.c_str (), ACE_TEXT ("a"));

            ACE_LOG_MSG->msg_ostream (output_stream, 1);

#else /* ! ACE_LACKS_IOSTREAM_TOTALLY */

            ofstream* output_stream = 0;

            ACE_NEW_NORETURN (output_stream,
                              ofstream ());
            if (output_stream)
              {
                output_stream->open (ACE_TEXT_ALWAYS_CHAR (filename.c_str ()),
                                    ios::out | ios::app);

                if (!output_stream->bad ())
                  {
                    ACE_LOG_MSG->msg_ostream (output_stream, 1);
                  }
              }

#endif /* ACE_LACKS_IOSTREAM_TOTALLY */

            ACE_LOG_MSG->clr_flags (ACE_Log_Msg::STDERR | ACE_Log_Msg::LOGGER);
            ACE_LOG_MSG->set_flags (ACE_Log_Msg::OSTREAM);


Member Data Documentation

unsigned int ACE::INet_Log::debug_level_ = INet_Log::Initializer () [static]

Definition at line 27 of file INet_Log.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines