Subversion Repositories Tewi

Rev

Rev 182 | Rev 212 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 182 Rev 191
Line 1... Line 1...
1
/* $Id: log.c 182 2024-09-27 12:55:12Z nishi $ */
1
/* $Id: log.c 191 2024-09-29 05:11:20Z nishi $ */
2
 
2
 
3
#include "cm_log.h"
3
#include "cm_log.h"
4
 
4
 
5
#include "cm_string.h"
5
#include "cm_string.h"
6
 
6
 
Line 13... Line 13...
13
 
13
 
14
#ifdef _PSP
14
#ifdef _PSP
15
#include <pspdebug.h>
15
#include <pspdebug.h>
16
#endif
16
#endif
17
 
17
 
-
 
18
#ifdef __PPU__
-
 
19
extern void tt_printf(const char* tmpl, ...);
-
 
20
#endif
-
 
21
 
18
FILE* logfile;
22
FILE* logfile;
19
 
23
 
20
bool cm_do_log = false;
24
bool cm_do_log = false;
21
 
25
 
22
#define LOGNAME_LENGTH 12
26
#define LOGNAME_LENGTH 12
Line 26... Line 30...
26
	struct tm* tm = localtime(&t);
30
	struct tm* tm = localtime(&t);
27
	char date[513];
31
	char date[513];
28
	strftime(date, 512, "%a %b %d %H:%M:%S %Z %Y", tm);
32
	strftime(date, 512, "%a %b %d %H:%M:%S %Z %Y", tm);
29
#ifdef _PSP
33
#ifdef _PSP
30
	pspDebugScreenPrintf("[%s] %s\n", date, log);
34
	pspDebugScreenPrintf("[%s] %s\n", date, log);
-
 
35
#elif defined(__PPU__)
-
 
36
	tt_printf("[%s] %s\n", date, log);
31
#else
37
#else
32
	fprintf(logfile, "[%s] %s\n", date, log);
38
	fprintf(logfile, "[%s] %s\n", date, log);
33
#endif
39
#endif
34
	fflush(logfile);
40
	fflush(logfile);
35
}
41
}
Line 76... Line 82...
76
		}
82
		}
77
	}
83
	}
78
 
84
 
79
#ifdef _PSP
85
#ifdef _PSP
80
	pspDebugScreenPrintf("%s %s\n", namebuf, result);
86
	pspDebugScreenPrintf("%s %s\n", namebuf, result);
-
 
87
#elif defined(__PPU__)
-
 
88
	tt_printf("%s %s\n", namebuf, result);
81
#else
89
#else
82
	fprintf(logfile, "%s %s\n", namebuf, result);
90
	fprintf(logfile, "%s %s\n", namebuf, result);
83
#endif
91
#endif
84
	va_end(args);
92
	va_end(args);
85
 
93