OSDN Git Service

Initial checkin for denncoCreator
[dennco/denncoCreator.git] / Source / engine / layer1 / TKLog.cpp
1 //  Copyright (c) 2012 Dennco Project
2 //
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16 //
17 //  Created by tkawata on 1/2/2012.
18 //
19
20 #include "TKConsole.h"
21 #include "TKLog.h"
22
23 #include <stdarg.h>
24
25 TKConsole *TKLog::msConsole = 0;
26
27 void TKLog::printf(MessageType type, const char* fmt,...)
28 {
29     if (TKLog::msConsole)
30     {
31         va_list ap;
32         va_start(ap, fmt);
33         msConsole->vprintf(type, fmt, ap);
34         va_end(ap);        
35     }
36 }
37
38 void TKLog::debugPrintf(const char* fmt,...)
39 {
40     if (TKLog::msConsole)
41     {
42         va_list ap;
43         va_start(ap, fmt);
44         msConsole->vDebugPrintf(fmt, ap);
45         va_end(ap);        
46     }
47 }
48
49 void TKLog::setDestination(TKConsole *console) 
50 {
51     TKLog::msConsole = console;
52 }
53