*** empty log message ***

This commit is contained in:
David Rose 2000-12-04 21:43:25 +00:00
parent d9b3cf736c
commit d107478789
3 changed files with 39 additions and 0 deletions

View File

@ -590,6 +590,7 @@ ConfigTable* ConfigTable::Instance(void) {
_instance = new ConfigTable;
_instance->GetData();
_instance->_initializing = false;
Notify::ptr()->config_initialized();
}
return _instance;
}

View File

@ -7,6 +7,8 @@
#include "config_notify.h"
#include "dconfig.h"
#include <filename.h>
#include <ctype.h>
Notify *Notify::_global_ptr = (Notify *)NULL;
@ -436,3 +438,36 @@ string_severity(const string &str) {
return NS_unspecified;
}
}
////////////////////////////////////////////////////////////////////
// Function: Notify::config_initialized
// Access: Public
// Description: Intended to be called only by Config, this is a
// callback that indicated to Notify when Config has
// done initializing and Notify can safely set up some
// internal state variables that depend on Config
// variables.
////////////////////////////////////////////////////////////////////
void Notify::
config_initialized() {
static bool already_initialized = false;
if (already_initialized) {
nout << "Notify::config_initialized() called more than once.\n";
return;
}
already_initialized = true;
if (_ostream_ptr == &cerr) {
Filename notify_output = config_notify.GetString("notify-output", "");
if (!notify_output.empty()) {
notify_output.set_text();
ofstream *out = new ofstream;
if (!notify_output.open_write(*out)) {
nout << "Unable to open file " << notify_output << " for output.\n";
delete out;
} else {
set_ostream_ptr(out, true);
}
}
}
}

View File

@ -61,6 +61,7 @@ PUBLISHED:
static void write_string(const string &str);
static Notify *ptr();
public:
static long get_literal_flag();
bool assert_failure(const char *expression, int line,
@ -68,6 +69,8 @@ PUBLISHED:
static NotifySeverity string_severity(const string &string);
void config_initialized();
private:
ostream *_ostream_ptr;
bool _owns_ostream_ptr;