Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use new style logging macros.
[simgrid.git] / teshsuite / xbt / log_large_test.c
1 /* log_large_test -- log a very large string to test the dynamic variants   */
2
3 /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #include "gras.h"
10 #include "xbt/synchro.h"
11
12 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logs of this example");
13
14
15 int main(int argc, char *argv[])
16 {
17   char *tmp = bprintf("\n%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s",
18                       1,
19                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
20                       2,
21                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
22                       3,
23                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
24                       4,
25                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
26                       5,
27                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
28                       6,
29                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
30                       7,
31                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
32                       8,
33                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
34                       9,
35                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
36                       0,
37                       ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n");
38
39   xbt_init(&argc, argv);
40
41   XBT_INFO("This is a very large message:\n0%s1%s2%s3%s4%s5%s6%s7%s8%s9%s",
42          tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp);
43   XBT_INFO("Done (strlen>%d)", (int) (10 * strlen(tmp)));
44   free(tmp);
45
46   return 0;
47 }