-/****************************************************************************
+/**************************************************************************
*
- * Copyright 2008 Jose Fonseca
+ * Copyright 2007-2010 VMware, Inc.
+ * All Rights Reserved.
*
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
*
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*
- ****************************************************************************/
+ **************************************************************************/
#ifndef _LOG_HPP_
#define _LOG_HPP_
-#include <windows.h>
-#include <tchar.h>
-
-
namespace Log {
- void Open(const TCHAR *szName);
- void ReOpen(void);
+ void Open(void);
void Close(void);
- void NewLine(void);
-
- void Tag(const char *name);
- void BeginTag(const char *name);
- void BeginTag(const char *name,
- const char *attr1, const char *value1);
- void BeginTag(const char *name,
- const char *attr1, const char *value1,
- const char *attr2, const char *value2);
- void EndTag(const char *name);
+ unsigned BeginEnter(const char *function);
+ void EndEnter(void);
- void Text(const char *text);
- void TextF(const char *format, ...);
+ void BeginLeave(unsigned call);
+ void EndLeave(void);
- void BeginCall(const char *function);
- void EndCall(void);
-
- void BeginArg(const char *type, const char *name);
- void EndArg(void);
+ void BeginArg(unsigned index, const char *name);
+ inline void EndArg(void) {}
- void BeginReturn(const char *type);
- void EndReturn(void);
+ void BeginReturn(void);
+ inline void EndReturn(void) {}
- void BeginElement(const char *type);
- void BeginElement(const char *type, const char *name);
- void EndElement(void);
+ void BeginArray(size_t length);
+ inline void EndArray(void) {}
- void BeginReference(const char *type, const void *addr);
- void EndReference(void);
+ inline void BeginElement(void) {}
+ inline void EndElement(void) {}
- void DumpString(const char *str);
-
+ void BeginStruct(size_t length);
+ inline void EndStruct(void) {}
+
+ void BeginMember(const char *name);
+ inline void EndMember(void) {}
+
+ void BeginBitmask(void);
+ void EndBitmask(void);
+
+ void LiteralBool(bool value);
+ void LiteralSInt(signed long long value);
+ void LiteralUInt(unsigned long long value);
+ void LiteralFloat(float value);
+ void LiteralFloat(double value);
+ void LiteralString(const char *str);
+ void LiteralString(const char *str, size_t size);
+ void LiteralWString(const wchar_t *str);
+ void LiteralBlob(const void *data, size_t size);
+ void LiteralNamedConstant(const char *name, long long value);
+ void LiteralNull(void);
+ void LiteralOpaque(const void *ptr);
+
+ void Abort(void);
}
#endif /* _LOG_HPP_ */