* src/toolbox/logging.h (log_text): Fixed for strings containing %.
[cacao.git] / src / toolbox / logging.h
1 /* src/toolbox/logging.h - contains logging functions
2
3    Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6    J. Wenninger, Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23    02110-1301, USA.
24
25    Contact: cacao@cacaojvm.org
26
27    Authors: Reinhard Grafl
28
29    Changes: Christan Thalinger
30
31    $Id: logging.h 5464 2006-09-11 14:45:13Z edwin $
32
33 */
34
35
36 #ifndef _LOGGING_H
37 #define _LOGGING_H
38
39 #include "config.h"
40
41 #include <stdio.h>
42 #include <stdarg.h>
43
44 #include "vm/class.h"
45 #include "vm/method.h"
46 #include "vm/utf8.h"
47
48
49 /*500 is to small for eclipse traces, (builtin_trace_args, perhaps the
50 buffer should be created there dynamically, if the text is longer,
51 instead of setting the size for all invocations that big*/
52
53 #define MAXLOGTEXT  16383 
54
55 /* function prototypes ********************************************************/
56
57 void log_init(const char *fname);
58
59 void log_start(void);
60
61 void log_vprint(const char *text, va_list ap);
62 void log_print(const char *text, ...);
63 void log_println(const char *text, ...);
64
65 void log_finish(void);
66
67
68 /* log message functions */
69 void log_message_utf(const char *msg, utf *u);
70 void log_message_class(const char *msg, classinfo *c);
71 void log_message_class_message_class(const char *msg1, classinfo *c1,
72                                                                          const char *msg2, classinfo *c2);
73 void log_message_method(const char *msg, methodinfo *m);
74
75 #define log_text(s) log_println("%s", (s))
76 #define dolog log_println
77
78 #endif /* _LOGGING_H */
79
80
81 /*
82  * These are local overrides for various environment variables in Emacs.
83  * Please do not remove this and leave it at the end of the file, where
84  * Emacs will automagically detect them.
85  * ---------------------------------------------------------------------
86  * Local variables:
87  * mode: c
88  * indent-tabs-mode: t
89  * c-basic-offset: 4
90  * tab-width: 4
91  * End:
92  */