Last change
on this file since 66 was 66, checked in by cheese, 11 years ago |
#1 add codec module (bin <-> hex-string)
|
File size:
781 bytes
|
Line | |
---|
1 | /**
|
---|
2 | * @file log.c
|
---|
3 | * @author myusgun <myusgun@gmail.com>
|
---|
4 | */
|
---|
5 | #include "cf_log.h"
|
---|
6 | #include <stdio.h>
|
---|
7 |
|
---|
8 | #define LOGID 1
|
---|
9 |
|
---|
10 | int main (void)
|
---|
11 | {
|
---|
12 | int i, j;
|
---|
13 | char logname[16] = {0x00,};
|
---|
14 |
|
---|
15 | if (CF_Log_Initialize (10) < 0)
|
---|
16 | {
|
---|
17 | fprintf (stderr, "failed to init. log\n");
|
---|
18 | return -1;
|
---|
19 | }
|
---|
20 |
|
---|
21 | for (i = 0 ; i < 10 ; i++)
|
---|
22 | {
|
---|
23 | sprintf (logname, "logid%d.txt", i);
|
---|
24 | if (CF_Log_Open (i, logname, CF_LOG_BUFFER_NO) < 0)
|
---|
25 | fprintf (stderr, "failed to open log\n");
|
---|
26 | }
|
---|
27 |
|
---|
28 | for (i = 0 ; i < 10 ; i++)
|
---|
29 | {
|
---|
30 | for (j = 0 ; j < 10000 ; j++)
|
---|
31 | {
|
---|
32 | int result = CF_Log_Write (i, "LOG_ID_TEST", "turn %d\n", j);
|
---|
33 | if (result < 0)
|
---|
34 | fprintf (stderr, "failed to write log %d\n", result);
|
---|
35 | }
|
---|
36 |
|
---|
37 | if (CF_Log_Close (i) < 0)
|
---|
38 | fprintf (stderr, "failed to close log\n");
|
---|
39 | }
|
---|
40 |
|
---|
41 | CF_Log_Finalize ();
|
---|
42 |
|
---|
43 | return 0;
|
---|
44 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.