~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201207201942

« back to all changes in this revision

Viewing changes to lib/include/toolsLogger.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-03-20 10:19:00 UTC
  • mfrom: (1.1.4 upstream) (2.4.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090320101900-1o604camiubq2de8
Tags: 2009.03.18-154848-2
Correcting patch system depends (Closes: #520493).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*********************************************************
2
 
 * Copyright (C) 2006 VMware, Inc. All rights reserved.
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or modify it
5
 
 * under the terms of the GNU Lesser General Public License as published
6
 
 * by the Free Software Foundation version 2.1 and no later version.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful, but
9
 
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
 
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the Lesser GNU General Public
11
 
 * License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU Lesser General Public License
14
 
 * along with this program; if not, write to the Free Software Foundation, Inc.,
15
 
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA.
16
 
 *
17
 
 *********************************************************/
18
 
 
19
 
/*
20
 
 * toolsLogger.h --
21
 
 *
22
 
 *    All-purpose logging facility. The API is not intended to be
23
 
 *    called from the application code. Instead the application
24
 
 *    should re-implement DLWP with ToolsLogger_Log() (before, they
25
 
 *    use printf()/fprintf()/OutputDebugString()).
26
 
 *
27
 
 *    A sample:
28
 
 *
29
 
 *    #include "toolsLogger.h"
30
 
 *
31
 
 *    GuestApp_Dict *confDict = Conf_Load();
32
 
 *
33
 
 *    ToolsLogger_Init(progName, confDict);
34
 
 *
35
 
 *    Log("a log msg") // == ToolsLogger_Log(TOOLSLOG_TYPE_LOG, "a log msg");
36
 
 *    Warning("a warning msg"); // == ToolsLogger_Log(TOOLSLOG_TYPE_WARNING, 
37
 
 *                              //       "a warning msg");
38
 
 * 
39
 
 *    Panic("a panic msg");     // == ToolsLogger_Log(TOOLSLOG_TYPE_PANIC,
40
 
 *                              //       "a panic msg"); exit(1);
41
 
 *
42
 
 *    ToolsLogger_Cleanup();
43
 
 */
44
 
 
45
 
 
46
 
#ifndef __TOOLSLOGGER_H__
47
 
#   define __TOOLSLOGGER_H__
48
 
 
49
 
 
50
 
#ifdef __cplusplus
51
 
extern "C" {
52
 
#endif
53
 
 
54
 
#include <stdarg.h>
55
 
 
56
 
/*
57
 
 * Log types
58
 
 */
59
 
typedef enum {
60
 
   TOOLSLOG_TYPE_PANIC,
61
 
   TOOLSLOG_TYPE_WARNING,
62
 
   TOOLSLOG_TYPE_LOG,
63
 
   
64
 
   TOOLSLOG_TYPE_LAST       /* Must be the last one */
65
 
} ToolsLogType;
66
 
 
67
 
 
68
 
Bool ToolsLogger_Init(const char *progName, GuestApp_Dict *conf);
69
 
 
70
 
void ToolsLogger_Log(ToolsLogType type, 
71
 
                     const char *fmt, 
72
 
                     ...);
73
 
 
74
 
void ToolsLogger_LogV(ToolsLogType type,
75
 
                      const char *fmt,
76
 
                      va_list args);
77
 
 
78
 
void ToolsLogger_Cleanup(void);
79
 
 
80
 
 
81
 
#ifdef __cplusplus
82
 
}
83
 
#endif
84
 
 
85
 
 
86
 
#endif /* __TOOLSLOGGER_H__ */