OLD | NEW |
| (Empty) |
1 // vim:set ts=4 sw=4 sts=4 cin et: | |
2 // | |
3 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
4 // Use of this source code is governed by a BSD-style license that can be | |
5 // found in the LICENSE file. | |
6 // | |
7 // This file defines a simple printf-style logging function that writes to the | |
8 // debug console in visual studio. To enable logging, define LOG_ENABLE before | |
9 // including this header file. | |
10 // | |
11 // Usage: | |
12 // | |
13 // { | |
14 // LOG(("foo bar: %d", blah())); | |
15 // ... | |
16 // } | |
17 // | |
18 // Parameters are only evaluated in debug builds. | |
19 // | |
20 #ifndef LogWin_h | |
21 #define LogWin_h | |
22 #undef LOG | |
23 | |
24 #if defined(LOG_ENABLE) && !defined(NDEBUG) | |
25 namespace WebCore { | |
26 class LogPrintf { | |
27 public: | |
28 LogPrintf(const char* f, int l) : m_file(f), m_line(l) {} | |
29 void __cdecl operator()(const char* format, ...); | |
30 private: | |
31 const char* m_file; | |
32 int m_line; | |
33 }; | |
34 } | |
35 #define LOG(args) WebCore::LogPrintf(__FILE__, __LINE__) args | |
36 #else | |
37 #define LOG(args) | |
38 #endif | |
39 | |
40 // Log a console message if a function is not implemented. | |
41 #ifndef notImplemented | |
42 #define notImplemented() do { \ | |
43 LOG(("FIXME: UNIMPLEMENTED %s()\n", __FUNCTION__)); \ | |
44 } while (0) | |
45 #endif | |
46 | |
47 #endif | |
48 | |
OLD | NEW |