Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 82 lines (71 sloc) 2.413 kb
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
1 #pragma once
2
3 /*
4 * Copyright (C) 2005-2008 Team XBMC
5 * http://www.xbmc.org
6 *
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, write to
19 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 * http://www.gnu.org/copyleft/gpl.html
21 *
22 */
23
24 #include <stdio.h>
97e6e29 Move m_repeatLine from CStdString to std string
althekiller authored
25 #include <string>
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
26
8a29f65 Rewrote the ReferenceCounting.h/cpp code for the boost-nuke branch. This...
Jim Carroll authored
27 #include "threads/CriticalSection.h"
5bc0358 Refactored all uses of form (1) (See the long description in GlobalsHand...
Jim Carroll authored
28 #include "utils/GlobalsHandling.h"
f6d2e07 Introduced reference counting for globals with utils/ReferenceCounting.h...
Jim Carroll authored
29
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
30 #define LOG_LEVEL_NONE -1 // nothing at all is logged
31 #define LOG_LEVEL_NORMAL 0 // shows notice, error, severe and fatal
32 #define LOG_LEVEL_DEBUG 1 // shows all
33 #define LOG_LEVEL_DEBUG_FREEMEM 2 // shows all + shows freemem on screen
34 #define LOG_LEVEL_DEBUG_SAMBA 3 // shows all + freemem on screen + samba debugging
35 #define LOG_LEVEL_MAX LOG_LEVEL_DEBUG_SAMBA
36
37 // ones we use in the code
38 #define LOGDEBUG 0
39 #define LOGINFO 1
40 #define LOGNOTICE 2
41 #define LOGWARNING 3
42 #define LOGERROR 4
43 #define LOGSEVERE 5
44 #define LOGFATAL 6
45 #define LOGNONE 7
46
47 #ifdef __GNUC__
48 #define ATTRIB_LOG_FORMAT __attribute__((format(printf,2,3)))
49 #else
50 #define ATTRIB_LOG_FORMAT
51 #endif
52
53 class CLog
54 {
55 public:
f6d2e07 Introduced reference counting for globals with utils/ReferenceCounting.h...
Jim Carroll authored
56
c3a6379 Cleaned up some of the grammar and spelling in the comments, thanks in l...
Jim Carroll authored
57 class CLogGlobals
f6d2e07 Introduced reference counting for globals with utils/ReferenceCounting.h...
Jim Carroll authored
58 {
59 public:
60 CLogGlobals() : m_file(NULL), m_repeatCount(0), m_repeatLogLevel(-1), m_logLevel(LOG_LEVEL_DEBUG) {}
61 FILE* m_file;
62 int m_repeatCount;
63 int m_repeatLogLevel;
64 std::string m_repeatLine;
65 int m_logLevel;
66 CCriticalSection critSec;
67 };
68
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
69 CLog();
70 virtual ~CLog(void);
71 static void Close();
72 static void Log(int loglevel, const char *format, ... ) ATTRIB_LOG_FORMAT;
73 static void MemDump(char *pData, int length);
df53f9e changed: CLog now uses a FILE*. avoids crashes if we cannot write the lo...
spiff_ authored
74 static bool Init(const char* path);
8841b1c Free logging class from advanced settings
althekiller authored
75 static void SetLogLevel(int level);
76 static int GetLogLevel();
85d61ae Clean up OutputDebugString usage some more.
althekiller authored
77 private:
78 static void OutputDebugString(const std::string& line);
45285e8 step 3/4: Move linuxport to trunk. How'd I get roped into this?
AlTheKiller authored
79 };
80
5bc0358 Refactored all uses of form (1) (See the long description in GlobalsHand...
Jim Carroll authored
81 XBMC_GLOBAL_REF(CLog::CLogGlobals,g_log_globals);
Something went wrong with that request. Please try again.