Mercurial > mercurial > hgweb_mover2.cgi
diff src/main.cpp @ 11:9b0840b0be7e
cache done.
author | pyon@macmini |
---|---|
date | Sun, 23 Oct 2011 07:43:34 +0900 |
parents | 52697c869ce8 |
children | d10eafafe31f |
line wrap: on
line diff
--- a/src/main.cpp Fri Oct 21 07:58:23 2011 +0900 +++ b/src/main.cpp Sun Oct 23 07:43:34 2011 +0900 @@ -1,5 +1,5 @@ // Filename : main.cpp -// Last Change: 18-Oct-2011. +// Last Change: 22-Oct-2011. // #include "common.h" @@ -26,6 +26,7 @@ wxImage::AddHandler( new wxPNGHandler ); ConfInit(); + InitLog(); wxString progname = wxT("A Mover"); wxString verstr = wxString::Format( wxT(" - v%d.%d ( build %d )"), VER, REV, BLD ); @@ -86,3 +87,23 @@ config->Read( wxT("zmax"), &zmax ); } +void MyApp::InitLog() +{ + wxDateTime now = wxDateTime::Now(); + wxTextFile logfile; + logfile.Open(wxT("log")); + logfile.Clear(); + logfile.AddLine( now.Format(wxT("%F %T ")) + wxT("[Application start...]") ); + logfile.Write(); + logfile.Close(); +} +void MyApp::WriteLog( wxString msg ) +{ + wxDateTime now = wxDateTime::Now(); + wxTextFile logfile; + logfile.Open(wxT("log")); + logfile.AddLine( now.Format(wxT("%F %T ")) + msg ); + logfile.Write(); + logfile.Close(); +} +