Project

General

Profile

Files » log.c

Frédéric Blanc, 2016-01-29 10:31

 
/**
* @brief sauvegarde fichier LOG
* @param aucun
* @return 0
* @date 25/02/2010
*
*/

#include <utility.h>
#include "var.h"

int save_LOG (char *texte)
{
struct tm tm;

SetCtrlVal (T_panel[PANEL_LOG].panel,P_LOG_TXT,"\n");
SetCtrlVal (T_panel[PANEL_LOG].panel,P_LOG_TXT,texte);
GetSystemDate (&tm.tm_mon,&tm.tm_mday ,&tm.tm_year );
GetSystemTime (&tm.tm_hour, &tm.tm_min,&tm.tm_sec );
fprintf (file_LOG,"%d/%2.2d/%2.2d-%2.2dh%2.2dm%2.2ds \t",tm.tm_year,tm.tm_mon,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
fprintf (file_LOG,texte);
fprintf (file_LOG,"\n");
fflush (file_LOG);

return 0;
}

/**
* @brief Test pour LOG
* @param aucun
* @return 0
* @date 25/02/2010
*
*/
int test_LOG(int test)
{
if(test)
save_LOG(" FAIL");
else
save_LOG(" OK");
return 0;
}
(11-11/25)