Fawkes API  Fawkes Development Version
fawkeslogging_tolua.cpp
1 /*
2 ** Lua binding: fawkeslogging
3 ** Generated automatically by tolua++-1.0.92
4 */
5 /* This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version. A runtime exception applies to
9  * this software (see LICENSE.GPL_WRE file mentioned below for details).
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Library General Public License for more details.
15  *
16  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
17  */
18 
19 #include <core/exception.h>
20 
21 #ifndef __cplusplus
22 #include "stdlib.h"
23 #endif
24 #include "string.h"
25 
26 #include "tolua++.h"
27 
28 /* Exported function */
29 TOLUA_API int tolua_fawkeslogging_open (lua_State* tolua_S);
30 
31 #include <logging/component.h>
32 
33 /* function to register type */
34 static void tolua_reg_types (lua_State* tolua_S)
35 {
36  tolua_usertype(tolua_S,"fawkes::ComponentLogger");
37 }
38 
39 /* method: log_debug of class fawkes::ComponentLogger */
40 #ifndef TOLUA_DISABLE_tolua_fawkeslogging_fawkes_ComponentLogger_log_debug00
41 static int tolua_fawkeslogging_fawkes_ComponentLogger_log_debug00(lua_State* tolua_S)
42 {
43 #ifndef TOLUA_RELEASE
44  tolua_Error tolua_err;
45  if (
46  !tolua_isusertype(tolua_S,1,"fawkes::ComponentLogger",0,&tolua_err) ||
47  !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
48  !tolua_isnoobj(tolua_S,3,&tolua_err)
49  )
50  goto tolua_lerror;
51  else
52 #endif
53  {
54  fawkes::ComponentLogger* self = (fawkes::ComponentLogger*) tolua_tousertype(tolua_S,1,0);
55  std::string message = ((std::string) tolua_tocppstring(tolua_S,2,0));
56 #ifndef TOLUA_RELEASE
57  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'log_debug'",NULL);
58 #endif
59  {
60  self->log_debug(message);
61  }
62  }
63  return 0;
64 #ifndef TOLUA_RELEASE
65  tolua_lerror:
66  tolua_error(tolua_S,"#ferror in function 'log_debug'.",&tolua_err);
67  return 0;
68 #endif
69 }
70 #endif //#ifndef TOLUA_DISABLE
71 
72 /* method: log_info of class fawkes::ComponentLogger */
73 #ifndef TOLUA_DISABLE_tolua_fawkeslogging_fawkes_ComponentLogger_log_info00
74 static int tolua_fawkeslogging_fawkes_ComponentLogger_log_info00(lua_State* tolua_S)
75 {
76 #ifndef TOLUA_RELEASE
77  tolua_Error tolua_err;
78  if (
79  !tolua_isusertype(tolua_S,1,"fawkes::ComponentLogger",0,&tolua_err) ||
80  !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
81  !tolua_isnoobj(tolua_S,3,&tolua_err)
82  )
83  goto tolua_lerror;
84  else
85 #endif
86  {
87  fawkes::ComponentLogger* self = (fawkes::ComponentLogger*) tolua_tousertype(tolua_S,1,0);
88  std::string message = ((std::string) tolua_tocppstring(tolua_S,2,0));
89 #ifndef TOLUA_RELEASE
90  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'log_info'",NULL);
91 #endif
92  {
93  self->log_info(message);
94  }
95  }
96  return 0;
97 #ifndef TOLUA_RELEASE
98  tolua_lerror:
99  tolua_error(tolua_S,"#ferror in function 'log_info'.",&tolua_err);
100  return 0;
101 #endif
102 }
103 #endif //#ifndef TOLUA_DISABLE
104 
105 /* method: log_warn of class fawkes::ComponentLogger */
106 #ifndef TOLUA_DISABLE_tolua_fawkeslogging_fawkes_ComponentLogger_log_warn00
107 static int tolua_fawkeslogging_fawkes_ComponentLogger_log_warn00(lua_State* tolua_S)
108 {
109 #ifndef TOLUA_RELEASE
110  tolua_Error tolua_err;
111  if (
112  !tolua_isusertype(tolua_S,1,"fawkes::ComponentLogger",0,&tolua_err) ||
113  !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
114  !tolua_isnoobj(tolua_S,3,&tolua_err)
115  )
116  goto tolua_lerror;
117  else
118 #endif
119  {
120  fawkes::ComponentLogger* self = (fawkes::ComponentLogger*) tolua_tousertype(tolua_S,1,0);
121  std::string message = ((std::string) tolua_tocppstring(tolua_S,2,0));
122 #ifndef TOLUA_RELEASE
123  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'log_warn'",NULL);
124 #endif
125  {
126  self->log_warn(message);
127  }
128  }
129  return 0;
130 #ifndef TOLUA_RELEASE
131  tolua_lerror:
132  tolua_error(tolua_S,"#ferror in function 'log_warn'.",&tolua_err);
133  return 0;
134 #endif
135 }
136 #endif //#ifndef TOLUA_DISABLE
137 
138 /* method: log_error of class fawkes::ComponentLogger */
139 #ifndef TOLUA_DISABLE_tolua_fawkeslogging_fawkes_ComponentLogger_log_error00
140 static int tolua_fawkeslogging_fawkes_ComponentLogger_log_error00(lua_State* tolua_S)
141 {
142 #ifndef TOLUA_RELEASE
143  tolua_Error tolua_err;
144  if (
145  !tolua_isusertype(tolua_S,1,"fawkes::ComponentLogger",0,&tolua_err) ||
146  !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
147  !tolua_isnoobj(tolua_S,3,&tolua_err)
148  )
149  goto tolua_lerror;
150  else
151 #endif
152  {
153  fawkes::ComponentLogger* self = (fawkes::ComponentLogger*) tolua_tousertype(tolua_S,1,0);
154  std::string message = ((std::string) tolua_tocppstring(tolua_S,2,0));
155 #ifndef TOLUA_RELEASE
156  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'log_error'",NULL);
157 #endif
158  {
159  self->log_error(message);
160  }
161  }
162  return 0;
163 #ifndef TOLUA_RELEASE
164  tolua_lerror:
165  tolua_error(tolua_S,"#ferror in function 'log_error'.",&tolua_err);
166  return 0;
167 #endif
168 }
169 #endif //#ifndef TOLUA_DISABLE
170 
171 /* Open function */
172 TOLUA_API int tolua_fawkeslogging_open (lua_State* tolua_S)
173 {
174  tolua_open(tolua_S);
175  tolua_reg_types(tolua_S);
176  tolua_module(tolua_S,NULL,0);
177  tolua_beginmodule(tolua_S,NULL);
178  tolua_module(tolua_S,"fawkes",0);
179  tolua_beginmodule(tolua_S,"fawkes");
180  tolua_cclass(tolua_S,"ComponentLogger","fawkes::ComponentLogger","",NULL);
181  tolua_beginmodule(tolua_S,"ComponentLogger");
182  tolua_function(tolua_S,"log_debug",tolua_fawkeslogging_fawkes_ComponentLogger_log_debug00);
183  tolua_function(tolua_S,"log_info",tolua_fawkeslogging_fawkes_ComponentLogger_log_info00);
184  tolua_function(tolua_S,"log_warn",tolua_fawkeslogging_fawkes_ComponentLogger_log_warn00);
185  tolua_function(tolua_S,"log_error",tolua_fawkeslogging_fawkes_ComponentLogger_log_error00);
186  tolua_endmodule(tolua_S);
187  tolua_endmodule(tolua_S);
188  tolua_endmodule(tolua_S);
189  return 1;
190 }
191 
192 
193 extern "C" {
194 #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
195  TOLUA_API int luaopen_fawkeslogging (lua_State* tolua_S) {
196  return tolua_fawkeslogging_open(tolua_S);
197 };
198 #endif
199 }
200 
201 
Component logger.
Definition: component.h:35