comparison transform/FileFeatureWriter.cpp @ 1140:c7f1300dbf64

Debug outputs
author Chris Cannam
date Tue, 03 Nov 2015 11:34:44 +0000
parents d74ebd2d2c49
children 87ae75da6527
comparison
equal deleted inserted replaced
1139:205250c5d2a2 1140:c7f1300dbf64
44 if (m_support & SupportOneFilePerTrackTransform) { 44 if (m_support & SupportOneFilePerTrackTransform) {
45 m_manyFiles = true; 45 m_manyFiles = true;
46 } else if (m_support & SupportOneFileTotal) { 46 } else if (m_support & SupportOneFileTotal) {
47 m_singleFileName = QString("output.%1").arg(m_extension); 47 m_singleFileName = QString("output.%1").arg(m_extension);
48 } else { 48 } else {
49 SVDEBUG << "FileFeatureWriter::FileFeatureWriter: ERROR: Invalid support specification " << support << endl; 49 cerr << "FileFeatureWriter::FileFeatureWriter: ERROR: Invalid support specification " << support << endl;
50 } 50 }
51 } 51 }
52 } 52 }
53 53
54 FileFeatureWriter::~FileFeatureWriter() 54 FileFeatureWriter::~FileFeatureWriter()
128 m_baseDir = i->second.c_str(); 128 m_baseDir = i->second.c_str();
129 } else if (i->first == "many-files") { 129 } else if (i->first == "many-files") {
130 if (m_support & SupportOneFilePerTrackTransform && 130 if (m_support & SupportOneFilePerTrackTransform &&
131 m_support & SupportOneFilePerTrack) { 131 m_support & SupportOneFilePerTrack) {
132 if (m_singleFileName != "") { 132 if (m_singleFileName != "") {
133 SVDEBUG << "FileFeatureWriter::setParameters: WARNING: Both one-file and many-files parameters provided, ignoring many-files" << endl; 133 cerr << "FileFeatureWriter::setParameters: WARNING: Both one-file and many-files parameters provided, ignoring many-files" << endl;
134 } else { 134 } else {
135 m_manyFiles = true; 135 m_manyFiles = true;
136 } 136 }
137 } 137 }
138 } else if (i->first == "one-file") { 138 } else if (i->first == "one-file") {
142 // may be on by default (for any FileFeatureWriter 142 // may be on by default (for any FileFeatureWriter
143 // that supports OneFilePerTrackTransform but not 143 // that supports OneFilePerTrackTransform but not
144 // OneFilePerTrack), so we need to be able to 144 // OneFilePerTrack), so we need to be able to
145 // override it 145 // override it
146 // if (m_manyFiles) { 146 // if (m_manyFiles) {
147 // SVDEBUG << "FileFeatureWriter::setParameters: WARNING: Both many-files and one-file parameters provided, ignoring one-file" << endl; 147 // cerr << "FileFeatureWriter::setParameters: WARNING: Both many-files and one-file parameters provided, ignoring one-file" << endl;
148 // } else { 148 // } else {
149 m_singleFileName = i->second.c_str(); 149 m_singleFileName = i->second.c_str();
150 // } 150 // }
151 } 151 }
152 } 152 }
153 } else if (i->first == "stdout") { 153 } else if (i->first == "stdout") {
154 if (m_support & SupportStdOut) { 154 if (m_support & SupportStdOut) {
155 if (m_singleFileName != "") { 155 if (m_singleFileName != "") {
156 SVDEBUG << "FileFeatureWriter::setParameters: WARNING: Both stdout and one-file provided, ignoring stdout" << endl; 156 cerr << "FileFeatureWriter::setParameters: WARNING: Both stdout and one-file provided, ignoring stdout" << endl;
157 } else { 157 } else {
158 m_stdout = true; 158 m_stdout = true;
159 } 159 }
160 } 160 }
161 } else if (i->first == "append") { 161 } else if (i->first == "append") {
171 TransformId transformId) 171 TransformId transformId)
172 { 172 {
173 if (m_singleFileName != "") { 173 if (m_singleFileName != "") {
174 if (QFileInfo(m_singleFileName).exists() && !(m_force || m_append)) { 174 if (QFileInfo(m_singleFileName).exists() && !(m_force || m_append)) {
175 cerr << endl << "FileFeatureWriter: ERROR: Specified output file \"" << m_singleFileName << "\" exists and neither --" << getWriterTag() << "-force nor --" << getWriterTag() << "-append flag is specified -- not overwriting" << endl; 175 cerr << endl << "FileFeatureWriter: ERROR: Specified output file \"" << m_singleFileName << "\" exists and neither --" << getWriterTag() << "-force nor --" << getWriterTag() << "-append flag is specified -- not overwriting" << endl;
176 SVDEBUG << "NOTE: To find out how to fix this problem, read the help for the --" << getWriterTag() << "-force" << endl << "and --" << getWriterTag() << "-append options" << endl; 176 cerr << "NOTE: To find out how to fix this problem, read the help for the --" << getWriterTag() << "-force" << endl << "and --" << getWriterTag() << "-append options" << endl;
177 return ""; 177 return "";
178 } 178 }
179 return m_singleFileName; 179 return m_singleFileName;
180 } 180 }
181 181
218 218
219 filename = QDir(dirname).filePath(filename); 219 filename = QDir(dirname).filePath(filename);
220 220
221 if (QFileInfo(filename).exists() && !(m_force || m_append)) { 221 if (QFileInfo(filename).exists() && !(m_force || m_append)) {
222 cerr << endl << "FileFeatureWriter: ERROR: Output file \"" << filename << "\" exists (for input file or URL \"" << trackId << "\" and transform \"" << transformId << "\") and neither --" << getWriterTag() << "-force nor --" << getWriterTag() << "-append is specified -- not overwriting" << endl; 222 cerr << endl << "FileFeatureWriter: ERROR: Output file \"" << filename << "\" exists (for input file or URL \"" << trackId << "\" and transform \"" << transformId << "\") and neither --" << getWriterTag() << "-force nor --" << getWriterTag() << "-append is specified -- not overwriting" << endl;
223 SVDEBUG << "NOTE: To find out how to fix this problem, read the help for the --" << getWriterTag() << "-force" << endl << "and --" << getWriterTag() << "-append options" << endl; 223 cerr << "NOTE: To find out how to fix this problem, read the help for the --" << getWriterTag() << "-force" << endl << "and --" << getWriterTag() << "-append options" << endl;
224 return ""; 224 return "";
225 } 225 }
226 226
227 return filename; 227 return filename;
228 } 228 }