961f8982e97aecc825023f0c45bd1942332cc404
[cacao.git] / src / toolbox / logging.h
1 /* src/toolbox/logging.h - contains logging functions
2
3    Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4    R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5    C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6    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., 59 Temple Place - Suite 330, Boston, MA
23    02111-1307, USA.
24
25    Contact: cacao@complang.tuwien.ac.at
26
27    Authors: Reinhard Grafl
28
29    Changes: Christan Thalinger
30
31    $Id: logging.h 3183 2005-09-15 20:07:37Z twisti $
32
33 */
34
35
36 #ifndef _LOGGING_H
37 #define _LOGGING_H
38
39 #include <stdio.h>
40
41 #include "config.h"
42 #include "vm/class.h"
43 #include "vm/method.h"
44 #include "vm/utf8.h"
45
46
47 /*500 is to small for eclipse traces, (builtin_trace_args, perhaps the
48 buffer should be created there dynamically, if the text is longer,
49 instead of setting the size for all invocations that big*/
50
51 #define MAXLOGTEXT  16383 
52
53 /* function prototypes ********************************************************/
54
55 void log_init(const char *fname);
56 void log_text(const char *txt);
57
58 /* same as log_text without "LOG: " and newline */
59 void log_plain(const char *txt);
60
61 /* fflush logfile */
62 void log_flush(void);
63
64 /* newline and fflush */
65 void log_nl(void);
66
67 /* log message functions */
68 void log_message_utf(const char *msg, utf *u);
69 void log_message_class(const char *msg, classinfo *c);
70 void log_message_class_message_class(const char *msg1, classinfo *c1,
71                                                                          const char *msg2, classinfo *c2);
72 void log_message_method(const char *msg, methodinfo *m);
73
74 void dolog(const char *txt, ...);
75
76 /* same as dolog without "LOG: " and newline*/
77 void dolog_plain(const char *txt, ...);
78
79 FILE *get_logfile(void);                        /* return the current logfile */
80
81 /* write utf symbol to logfile/stdout */
82 void log_utf(utf *u);
83 void log_plain_utf(utf *u);
84
85 #endif /* _LOGGING_H */
86
87
88 /*
89  * These are local overrides for various environment variables in Emacs.
90  * Please do not remove this and leave it at the end of the file, where
91  * Emacs will automagically detect them.
92  * ---------------------------------------------------------------------
93  * Local variables:
94  * mode: c
95  * indent-tabs-mode: t
96  * c-basic-offset: 4
97  * tab-width: 4
98  * End:
99  */