HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_UniversalLogGenericSource.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_UniversalLogGenericSource.h (UT Library, C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __UT_UniversalLogGenericSource__
13 #define __UT_UniversalLogGenericSource__
14 
15 #include "UT_API.h"
16 #include "UT_Error.h"
17 #include "UT_StringHolder.h"
18 #include "UT_UniversalLogEntry.h"
19 
22 
23 UT_API extern bool UTlogSourceExists(
25 UT_API extern void UTlogEntry(const UT_UniversalLogEntry& entry,
27 
29 {
30 public:
33 };
34 
35 template <typename... Args>
36 void
38  const UT_StringHolder& source_name,
39  const char* fmt,
40  Args&&... args)
41 {
42  UT_StringHolder msg;
43  msg.format(fmt, std::forward<Args>(args)...);
44  UTlogEntry(UT_UniversalLogEntry(source_name, msg, "", UT_ERROR_MESSAGE));
45 }
46 
47 template <typename... Args>
48 void
49 UTlogPrompt(const UT_StringHolder& source_name, const char* fmt, Args&&... args)
50 {
51  UT_StringHolder msg;
52  msg.format(fmt, std::forward<Args>(args)...);
53  UTlogEntry(UT_UniversalLogEntry(source_name, msg, "", UT_ERROR_PROMPT));
54 }
55 
56 template <typename... Args>
57 void
59  const UT_StringHolder& source_name,
60  const char* fmt,
61  Args&&... args)
62 {
63  UT_StringHolder msg;
64  msg.format(fmt, std::forward<Args>(args)...);
65  UTlogEntry(UT_UniversalLogEntry(source_name, msg, "", UT_ERROR_WARNING));
66 }
67 
68 template <typename... Args>
69 void
70 UTlogError(const UT_StringHolder& source_name, const char* fmt, Args&&... args)
71 {
72  UT_StringHolder msg;
73  msg.format(fmt, std::forward<Args>(args)...);
74  UTlogEntry(UT_UniversalLogEntry(source_name, msg, "", UT_ERROR_ABORT));
75 }
76 
77 template <typename... Args>
78 void
79 UTlogFatal(const UT_StringHolder& source_name, const char* fmt, Args&&... args)
80 {
81  UT_StringHolder msg;
82  msg.format(fmt, std::forward<Args>(args)...);
83  UTlogEntry(UT_UniversalLogEntry(source_name, msg, "", UT_ERROR_FATAL));
84 }
85 
86 #endif
UT_API const UT_StringHolder & UTgetLoggingSourceGenericName()
void UTlogPrompt(const UT_StringHolder &source_name, const char *fmt, Args &&...args)
#define UT_API
Definition: UT_API.h:14
void UTlogFatal(const UT_StringHolder &source_name, const char *fmt, Args &&...args)
UT_API void UTlogEntry(const UT_UniversalLogEntry &entry, const UT_StringHolder &source_name=UT_StringHolder::theEmptyString)
UT_UniversalLogGenericRegistration(const UT_StringHolder &source_name)
static const UT_StringHolder theEmptyString
void UTlogError(const UT_StringHolder &source_name, const char *fmt, Args &&...args)
size_t format(const char *fmt, const Args &...args)
Format a string using the same formatting codes as UTformat.
UT_API bool UTlogSourceExists(const UT_StringHolder &source_name=UT_StringHolder::theEmptyString)
void UTlogMessage(const UT_StringHolder &source_name, const char *fmt, Args &&...args)
**If you just want to fire and args
Definition: thread.h:609
UT_API const UT_StringHolder & UTgetLoggingSourcePythonName()
Simple object to hold the data associated with a single log entry event.
void UTlogWarning(const UT_StringHolder &source_name, const char *fmt, Args &&...args)