From d8a50ad49ec9b6403e6e05e14a6c50694cb42061 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 12 Mar 2002 19:55:49 +0000 Subject: [PATCH] Added a new 'delimiter' property to allow an alternative delimiter to the comma, and fixed a constant that was causing CygWin compilation problems. --- src/Main/logger.cxx | 9 ++++++--- src/Main/logger.hxx | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Main/logger.cxx b/src/Main/logger.cxx index 9dfe7399c..3e42f23cb 100644 --- a/src/Main/logger.cxx +++ b/src/Main/logger.cxx @@ -44,6 +44,7 @@ FGLogger::init () SGPropertyNode * child = children[i]; string filename = child->getStringValue("filename", "fg_log.csv"); log.interval_ms = child->getLongValue("interval-ms", 0); + log.delimiter = child->getStringValue("delimiter", ",")[0]; log.output = new ofstream(filename.c_str()); if (!log.output) { SG_LOG(SG_INPUT, SG_ALERT, "Cannot write log to " << filename); @@ -56,7 +57,7 @@ FGLogger::init () SGPropertyNode * node = fgGetNode(entry->getStringValue("property"), true); log.nodes.push_back(node); - (*log.output) << ',' + (*log.output) << log.delimiter << entry->getStringValue("title", node->getPath()); } (*log.output) << endl; @@ -82,7 +83,8 @@ FGLogger::update (int dt) _logs[i].last_time_ms = elapsed_ms; (*_logs[i].output) << globals->get_elapsed_time_ms(); for (int j = 0; j < _logs[i].nodes.size(); j++) { - (*_logs[i].output) << ',' << _logs[i].nodes[j]->getStringValue(); + (*_logs[i].output) << _logs[i].delimiter + << _logs[i].nodes[j]->getStringValue(); } (*_logs[i].output) << endl; } @@ -98,7 +100,8 @@ FGLogger::update (int dt) FGLogger::Log::Log () : output(0), interval_ms(0), - last_time_ms(-99999999999999L) + last_time_ms(-999999L), + delimiter(',') { } diff --git a/src/Main/logger.hxx b/src/Main/logger.hxx index ef11ef7da..cdadc2530 100644 --- a/src/Main/logger.hxx +++ b/src/Main/logger.hxx @@ -56,6 +56,7 @@ private: ostream * output; long interval_ms; long last_time_ms; + char delimiter; }; vector _logs;