MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / logFile

Function logFile

SRC/runtime/commands/interpreter.cpp:189–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187
188
189static int
190logFile(ClientData clientData, Tcl_Interp *interp, Tcl_Size argc, TCL_Char ** const argv)
191{
192 if (argc < 2) {
193 opserr << "WARNING no filename supplied\n";
194 return TCL_ERROR;
195 }
196 bool echo = true;
197 openMode mode = openMode::OVERWRITE;
198
199 int cArg = 2;
200 while (cArg < argc) {
201 if (strcmp(argv[cArg], "-append") == 0)
202 mode = openMode::APPEND;
203
204 if (strcmp(argv[cArg], "-noEcho") == 0)
205 echo = false;
206 cArg++;
207 }
208
209 if (opserr.setFile(argv[1], mode, echo) < 0) {
210 opserr << "WARNING logFile " << argv[1] << " failed to set the file"
211 << "\n";
212 }
213 std::string cmd = std::string{"namespace eval opensees::internal {set log_file \""}
214 + std::string{argv[1]}
215 + std::string{"\"}\n"};
216
217 Tcl_Eval(interp, cmd.c_str());
218
219 return TCL_OK;
220}
221
222static int
223setPrecision(ClientData clientData, Tcl_Interp *interp, Tcl_Size argc,

Callers

nothing calls this directly

Calls 1

setFileMethod · 0.45

Tested by

no test coverage detected