output messages that would otherwise only show up in logs only when logs are enable for screen or logfile
This commit is contained in:
@ -363,8 +363,8 @@ void KimInit::kim_init_log_delimiter(std::string const begin_end) const
|
|||||||
mesg =
|
mesg =
|
||||||
"#=== END kim-init ============================================\n\n";
|
"#=== END kim-init ============================================\n\n";
|
||||||
|
|
||||||
if (screen) fputs(mesg.c_str(),screen);
|
if ((screen) && (input->echo_screen)) fputs(mesg.c_str(),screen);
|
||||||
if (logfile) fputs(mesg.c_str(),logfile);
|
if ((logfile) && (input->echo_log)) fputs(mesg.c_str(),logfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,8 +411,8 @@ void KimInit::do_variables(char *user_units, char *model_units)
|
|||||||
mesg += " to ";
|
mesg += " to ";
|
||||||
mesg += to;
|
mesg += to;
|
||||||
mesg += ":\n";
|
mesg += ":\n";
|
||||||
if (screen) fputs(mesg.c_str(),screen);
|
if ((screen) && (input->echo_screen)) fputs(mesg.c_str(),screen);
|
||||||
if (logfile) fputs(mesg.c_str(),logfile);
|
if ((logfile) && (input->echo_log)) fputs(mesg.c_str(),logfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < nunits; i++) {
|
for (int i = 0; i < nunits; i++) {
|
||||||
@ -441,12 +441,12 @@ void KimInit::do_variables(char *user_units, char *model_units)
|
|||||||
<< " internal "
|
<< " internal "
|
||||||
<< std::setprecision(12) << std::scientific << conversion_factor
|
<< std::setprecision(12) << std::scientific << conversion_factor
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
if (screen) fputs(mesg.str().c_str(),screen);
|
if ((screen) && (input->echo_screen)) fputs(mesg.str().c_str(),screen);
|
||||||
if (logfile) fputs(mesg.str().c_str(),logfile);
|
if ((logfile) && (input->echo_log)) fputs(mesg.str().c_str(),logfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (comm->me == 0) {
|
if (comm->me == 0) {
|
||||||
if (screen) fputs("#\n",screen);
|
if ((screen) && (input->echo_screen)) fputs("#\n",screen);
|
||||||
if (logfile) fputs("#\n",logfile);
|
if ((logfile) && (input->echo_log)) fputs("#\n",logfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,8 +109,8 @@ void KimInteractions::kim_interactions_log_delimiter(
|
|||||||
mesg =
|
mesg =
|
||||||
"#=== END kim_interactions ====================================\n\n";
|
"#=== END kim_interactions ====================================\n\n";
|
||||||
|
|
||||||
if (screen) fputs(mesg.c_str(),screen);
|
if ((screen) && (input->echo_screen)) fputs(mesg.c_str(),screen);
|
||||||
if (logfile) fputs(mesg.c_str(),logfile);
|
if ((logfile) && (input->echo_log)) fputs(mesg.c_str(),logfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,8 @@ class Input : protected Pointers {
|
|||||||
friend class Info;
|
friend class Info;
|
||||||
friend class Error;
|
friend class Error;
|
||||||
friend class Deprecated;
|
friend class Deprecated;
|
||||||
|
friend class KimInit;
|
||||||
|
friend class KimInteractions;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int narg; // # of command args
|
int narg; // # of command args
|
||||||
@ -42,14 +44,14 @@ class Input : protected Pointers {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
char *command; // ptr to current command
|
char *command; // ptr to current command
|
||||||
|
int echo_screen; // 0 = no, 1 = yes
|
||||||
|
int echo_log; // 0 = no, 1 = yes
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int me; // proc ID
|
int me; // proc ID
|
||||||
int maxarg; // max # of args in arg
|
int maxarg; // max # of args in arg
|
||||||
char *line,*copy,*work; // input line & copy and work string
|
char *line,*copy,*work; // input line & copy and work string
|
||||||
int maxline,maxcopy,maxwork; // max lengths of char strings
|
int maxline,maxcopy,maxwork; // max lengths of char strings
|
||||||
int echo_screen; // 0 = no, 1 = yes
|
|
||||||
int echo_log; // 0 = no, 1 = yes
|
|
||||||
int nfile,maxfile; // current # and max # of open input files
|
int nfile,maxfile; // current # and max # of open input files
|
||||||
int label_active; // 0 = no label, 1 = looking for label
|
int label_active; // 0 = no label, 1 = looking for label
|
||||||
char *labelstr; // label string being looked for
|
char *labelstr; // label string being looked for
|
||||||
|
|||||||
Reference in New Issue
Block a user