Log file update

* Write UTF-8 to log file
  * Remove redundant code
    - open log file in main.cxx
    - also in function create_fl_digi_main_primary()
pull/1/head
Andrej Lajovic 2012-09-29 19:29:35 -05:00 zatwierdzone przez David Freese
rodzic 3e0dac76fe
commit 2a391bcfef
3 zmienionych plików z 3 dodań i 13 usunięć

Wyświetl plik

@ -6449,7 +6449,6 @@ void put_echo_char(unsigned int data, int style)
if (asc == ascii2 && iscntrl(data))
style = FTextBase::CTRL;
#if FLDIGI_FLTK_API_MAJOR == 1 && FLDIGI_FLTK_API_MINOR == 3
sch.clear();
if (asc != NULL) { // MAIL / ARQ / RTTY / CW
sch.assign(asc[data & 0xFF]);
@ -6461,6 +6460,7 @@ void put_echo_char(unsigned int data, int style)
sch.assign(" ");
sch[0] = data;
}
#if FLDIGI_FLTK_API_MAJOR == 1 && FLDIGI_FLTK_API_MINOR == 3
REQ(&FTextRX::addstr, ReceiveText, sch, style);
#else
REQ(&FTextBase::addchr, ReceiveText, data, style);
@ -6471,7 +6471,7 @@ void put_echo_char(unsigned int data, int style)
Maillogfile->log_to_file(cLogfile::LOG_TX, s);
if (progStatus.LOGenabled)
logfile->log_to_file(cLogfile::LOG_TX, s);
logfile->log_to_file(cLogfile::LOG_TX, sch);
}
void resetRTTY() {

Wyświetl plik

@ -413,16 +413,6 @@ int main(int argc, char ** argv)
if (progdefaults.XmlRigFilename.empty())
progdefaults.XmlRigFilename = xmlfname;
if (progStatus.LOGenabled == true) {
Date tdy;
string lfname = HomeDir;
lfname.append("fldigi");
lfname.append(tdy.szDate(2));
lfname.append(".log");
logfile = new cLogfile(lfname);
logfile->log_to_file_start();
}
#if BENCHMARK_MODE
return setup_benchmark();
#endif

Wyświetl plik

@ -82,7 +82,7 @@ void cLogfile::log_to_file(log_t type, const string& s)
fprintf(logfile, "%s %s : %s (%s): ", lognames[type], freq, logmode, timestr);
}
for (size_t i = 0; i < s.length(); i++)
if (s[i] == '\n' || s[i] >= ' ') fprintf(logfile, "%c", s[i]);
if (s[i] == '\n' || (unsigned char)s[i] >= ' ') fprintf(logfile, "%c", s[i]);
retflag = *s.rbegin() == '\n';
if (!retflag)
fflush(logfile);