source: trunk/src/log.h @ 1646

Last change on this file since 1646 was 1646, checked in by sam, 8 years ago

core: on Windows, output log messages to the Visual Studio debug window
if appropriate.

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://sam.zoy.org/projects/COPYING.WTFPL for more details.
9//
10
11//
12// The Log interface
13// -----------------
14// The central logging system.
15//
16
17#if !defined __LOL_LOG_H__
18#define __LOL_LOG_H__
19
20#include <stdint.h>
21#include <cstdarg>
22
23namespace lol
24{
25
26class Log
27{
28public:
29#ifdef __GNUC__
30#   define LOL_FMT_ATTR(n, p) __attribute__((format(printf, n, p)))
31#else
32#   define LOL_FMT_ATTR(n, p)
33#endif
34    static void Debug(char const *format, ...) LOL_FMT_ATTR(1, 2);
35    static void Info(char const *format, ...) LOL_FMT_ATTR(1, 2);
36    static void Warn(char const *format, ...) LOL_FMT_ATTR(1, 2);
37    static void Error(char const *format, ...) LOL_FMT_ATTR(1, 2);
38#undef LOL_FMT_ATTR
39
40private:
41    static void Helper(char const *prefix, char const *format, va_list ap);
42};
43
44} /* namespace lol */
45
46#endif // __LOL_LOG_H__
47
Note: See TracBrowser for help on using the repository browser.