MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / sendLog

Method sendLog

src/Base/ConsoleObserver.cpp:63–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void ConsoleObserverFile::sendLog(
64 const std::string& notifiername,
65 const std::string& msg,
66 LogStyle level,
67 IntendedRecipient recipient,
68 ContentType content
69)
70{
71 (void)notifiername;
72
73 // Do not log translated messages, or messages intended only to the user to log file
74 if (recipient == IntendedRecipient::User || content == ContentType::Translated) {
75 return;
76 }
77
78 std::string prefix;
79 switch (level) {
80 case LogStyle::Warning:
81 prefix = "Wrn: ";
82 break;
83 case LogStyle::Message:
84 prefix = "Msg: ";
85 break;
86 case LogStyle::Error:
87 prefix = "Err: ";
88 break;
89 case LogStyle::Log:
90 prefix = "Log: ";
91 break;
92 case LogStyle::Critical:
93 prefix = "Critical: ";
94 break;
95 default:
96 break;
97 }
98
99 cFileStream << prefix << msg;
100 cFileStream.flush();
101}
102
103ConsoleObserverStd::ConsoleObserverStd()
104 :

Callers 2

saveToLogMethod · 0.45
notifyPrivateMethod · 0.45

Calls 7

WarningMethod · 0.95
MessageMethod · 0.95
ErrorMethod · 0.95
LogMethod · 0.95
CriticalMethod · 0.95
flushMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected