You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// The context is updated from available environment information, if any.
52
57
InfoLoggerContext();
@@ -61,10 +66,18 @@ class InfoLoggerContext final
61
66
/// All fields are cleared with default values.
62
67
voidreset();
63
68
64
-
/// Update context from current environment information.
69
+
/// Update context from current environment information (of current process).
65
70
/// Fields previously set by user may be overwritten.
66
71
voidrefresh();
67
-
72
+
73
+
74
+
/// Update context from current environment information of a different process.
75
+
/// This is used internally by command line 'log' utility to tag messages issued by parent process
76
+
/// or on stdout by a program which output is piped to stdin of current process and injected in infologger.
77
+
/// Fields previously set by user may be overwritten.
78
+
voidrefresh(pid_t pid);
79
+
80
+
68
81
/// Destroy context
69
82
~InfoLoggerContext();
70
83
@@ -84,8 +97,8 @@ class InfoLoggerContext final
84
97
85
98
// todo ?
86
99
// int getField(FieldName key, std::string &value);
87
-
88
-
100
+
101
+
89
102
private:
90
103
// field undefined: empty string (for strings) or -1 (for integers)
91
104
@@ -102,6 +115,8 @@ class InfoLoggerContext final
102
115
std::string hostName; // name of host running the message source process
103
116
std::string userName; // user running the message source process
104
117
118
+
// ideas of other possible fields: thread id, exe name, ...
119
+
105
120
friendclassInfoLogger;
106
121
};
107
122
@@ -196,6 +211,20 @@ class InfoLogger final
196
211
};
197
212
198
213
214
+
/// Convert a string to an infologger severity
215
+
/// \param text NUL-terminated word to convert to InfoLogger severity type. Current implementation is not exact-match, it takes closest based on first-letter value
216
+
/// \return Corresponding severity (InfoLogger::Undefined if no match found)
/// \param text NUL-terminated word to convert to InfoLogger severity type. Current implementation is not exact-match, it takes closest based on first-letter value
256
-
/// \return Corresponding severity (InfoLogger::Undefined if no match found)
0 commit comments