hello...how are you
can you help me for this code , i have 3 error
i can not solve it
===========================================
LogClass Logging;
LogClass LoggingParser;
void LogClass::Logit(string logData, string logType, string thn)
{
static FILE *tfile = 0;
char *tmp = new char[201];
DateTimeClass DateTime;
string timeNow = DateTime.formatDT("");
string outData = "";
string filename = LogPath + "/" + LogFilename;
if (tfile == 0)
{
tfile = fopen(filename.c_str(), "at");
if (!tfile)
tfile = fopen(filename.c_str(), "wt");
if (!tfile)
{
cout << "Error creating or accessing log file." << endl;
return;
}
}
for (unsigned int i=0;i<logData.length();i+=50)
{
sprintf(tmp, "%12s %s %s (%2s) %-50s\r\n", "tadapp", timeNow.c_str(),
logType.c_str(), thn.c_str(), logData.substr(i,50).c_str());
if (tfile!=NULL)
fputs (tmp,tfile);
}
fflush(tfile);
delete []tmp;
}
void LogClass::Logit2(string logData, string logType, string thn)
{
static FILE *tfile = 0;
char *tmp = new char[201];
DateTimeClass DateTime;
string timeNow = DateTime.formatDT("");
string outData = "";
string filename = LogPath + "/" + "tadParserapp.log";
if (tfile == 0)
{
tfile = fopen(filename.c_str(), "at");
if (!tfile)
tfile = fopen(filename.c_str(), "wt");
if (!tfile)
{
cout << "Error creating or accessing log file." << endl;
return;
}
}
for (unsigned int i=0;i<logData.length();i+=50)
{
sprintf(tmp, "%12s %s %s (%2s) %-50s\r\n", "tadpaerser", timeNow.c_str(),
logType.c_str(), thn.c_str(), logData.substr(i,50).c_str());
if (tfile!=NULL)
fputs (tmp,tfile);
}
fflush(tfile);
delete []tmp;
}
int main(int argcount, char* argv[])
{
if (argcount == 1)
LogPath = "/root";
else
LogPath = argv[1];
LogFilename = "tadapp.log";
Logging.Logit("Started...","INF", "0");
Logging.Logit("Ended...","INF", "0");
return 0;
}
==================================================
thank you for help me ...
my email to cannection is [email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at
http://groups.google.com/group/linuxusersgroup
-~----------~----~----~----~------~----~------~--~---