diff --git a/src/DynareMain.cc b/src/DynareMain.cc index 57857ff0c299b39622b7945e9b09c6aba43475df..b5ef7db77d71dde2815f06a8f1f1da3932be6315 100644 --- a/src/DynareMain.cc +++ b/src/DynareMain.cc @@ -1,5 +1,5 @@ /* - * Copyright © 2003-2020 Dynare Team + * Copyright © 2003-2021 Dynare Team * * This file is part of Dynare. * @@ -52,6 +52,9 @@ macroExpandModFile(const string &filename, const string &basename, const istream void usage() { + /* "nolog" is in the following output, even though it is not parsed by the + preprocessor but by dynare.m, so that users get the right list of options + if they call the preprocessor from MATLAB/Octave. */ cerr << "Dynare usage: dynare mod_file [debug] [noclearall] [onlyclearglobals] [savemacro[=macro_file]] [onlymacro] [linemacro] [notmpterms] [nolog] [warn_uninit]" << " [console] [nograph] [nointeractive] [parallel[=cluster_name]] [conffile=parallel_config_path_and_filename] [parallel_slave_open_mode] [parallel_test]" << " [-D<variable>[=<value>]] [-I/path] [nostrict] [stochastic] [fast] [minimal_workspace] [compute_xrefs] [output=dynamic|first|second|third] [language=matlab|julia]" @@ -132,7 +135,6 @@ main(int argc, char **argv) bool no_tmp_terms = false; bool only_macro = false; bool line_macro = false; - bool no_log = false; bool no_warn = false; int params_derivs_order = 2; bool warn_uninit = false; @@ -210,8 +212,6 @@ main(int argc, char **argv) line_macro = true; else if (s == "notmpterms") no_tmp_terms = true; - else if (s == "nolog") - no_log = true; else if (s == "nowarn") no_warn = true; else if (s == "warn_uninit") @@ -497,7 +497,7 @@ main(int argc, char **argv) if (output_mode != FileOutputType::none) mod_file->writeExternalFiles(basename, language); else - mod_file->writeOutputFiles(basename, clear_all, clear_global, no_log, no_warn, console, nograph, + mod_file->writeOutputFiles(basename, clear_all, clear_global, no_warn, console, nograph, nointeractive, config_file, check_model_changes, minimal_workspace, compute_xrefs, mexext, matlabroot, dynareroot, onlymodel, gui, notime); diff --git a/src/ModFile.cc b/src/ModFile.cc index 16e1e723d4e230f47b574c354603bf3044478223..b101bd8889a64d74a2d5018ef5eaeeb89fa9f74a 100644 --- a/src/ModFile.cc +++ b/src/ModFile.cc @@ -1,5 +1,5 @@ /* - * Copyright © 2006-2020 Dynare Team + * Copyright © 2006-2021 Dynare Team * * This file is part of Dynare. * @@ -839,7 +839,7 @@ ModFile::computingPass(bool no_tmp_terms, FileOutputType output, int params_deri } void -ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_global, bool no_log, bool no_warn, +ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_global, bool no_warn, bool console, bool nograph, bool nointeractive, const ConfigFile &config_file, bool check_model_changes, bool minimal_workspace, bool compute_xrefs, const string &mexext, @@ -928,10 +928,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo << "%" << endl; if (!onlymodel) config_file.writeHooks(mOutputFile); - mOutputFile << "global_initialization;" << endl - << "diary off;" << endl; - if (!no_log) - mOutputFile << "diary('" << basename << ".log');" << endl; + mOutputFile << "global_initialization;" << endl; if (minimal_workspace) mOutputFile << "options_.minimal_workspace = true;" << endl; @@ -1120,9 +1117,6 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo } } - if (!no_log) - mOutputFile << "diary off" << endl; - mOutputFile.close(); if (hasModelChanged) diff --git a/src/ModFile.hh b/src/ModFile.hh index fbcaaa135f2c8f21e1a85f2fb29a15a6fdb48a72..3a7375fad85ad90534e1a670cf0dd0efeb32f160 100644 --- a/src/ModFile.hh +++ b/src/ModFile.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2006-2020 Dynare Team + * Copyright © 2006-2021 Dynare Team * * This file is part of Dynare. * @@ -165,7 +165,7 @@ public: \param mingw Should the MEX command of use_dll be adapted for MinGW? \param compute_xrefs if true, equation cross references will be computed */ - void writeOutputFiles(const string &basename, bool clear_all, bool clear_global, bool no_log, bool no_warn, + void writeOutputFiles(const string &basename, bool clear_all, bool clear_global, bool no_warn, bool console, bool nograph, bool nointeractive, const ConfigFile &config_file, bool check_model_changes, bool minimal_workspace, bool compute_xrefs, const string &mexext, const filesystem::path &matlabroot,