| 187 | |
| 188 | |
| 189 | static int |
| 190 | logFile(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 | |
| 222 | static int |
| 223 | setPrecision(ClientData clientData, Tcl_Interp *interp, Tcl_Size argc, |