Ilogger - Separate behaviour for user exposed and not exposed loggers

This commit is contained in:
Abdullah Tahiri
2023-05-20 21:49:40 +02:00
committed by abdullahtahiriyo
parent 9d9f928b2d
commit 5f52885fbf
5 changed files with 24 additions and 11 deletions

View File

@@ -62,8 +62,10 @@ void ConsoleObserverFile::SendLog(const std::string& notifiername, const std::st
IntendedRecipient recipient, ContentType content)
{
(void) notifiername;
(void) recipient;
(void) content;
// Do not log translated messages, or messages intended only to the user to log file
if(recipient == IntendedRecipient::User || content == ContentType::Translated)
return;
std::string prefix;
switch(level){
@@ -108,8 +110,10 @@ void ConsoleObserverStd::SendLog(const std::string& notifiername, const std::str
IntendedRecipient recipient, ContentType content)
{
(void) notifiername;
(void) recipient;
(void) content;
// Do not log translated messages, or messages intended only to the user to std log
if(recipient == IntendedRecipient::User || content == ContentType::Translated)
return;
switch(level){
case LogStyle::Warning:

View File

@@ -125,8 +125,10 @@ void GUIConsole::SendLog(const std::string& notifiername, const std::string& msg
Base::IntendedRecipient recipient, Base::ContentType content)
{
(void) notifiername;
(void) recipient;
(void) content;
// Do not log translated messages, or messages intended only to the user to std log
if(recipient == Base::IntendedRecipient::User || content == Base::ContentType::Translated)
return;
switch(level){
case Base::LogStyle::Warning:

View File

@@ -2256,8 +2256,12 @@ void StatusBarObserver::SendLog(const std::string& notifiername, const std::stri
Base::IntendedRecipient recipient, Base::ContentType content)
{
(void) notifiername;
(void) recipient;
(void) content;
// Do not log untranslated messages, or messages intended only to a developer to status bar
if( recipient == Base::IntendedRecipient::Developer ||
content == Base::ContentType::Untranslated ||
content == Base::ContentType::Untranslatable )
return;
int messageType = -1;
switch(level){

View File

@@ -476,8 +476,11 @@ void ReportOutput::SendLog(const std::string& notifiername, const std::string& m
Base::IntendedRecipient recipient, Base::ContentType content)
{
(void) notifiername;
(void) recipient;
(void) content;
// Do not log translated messages, or messages intended only to the user to the Report View
if( recipient == Base::IntendedRecipient::User ||
content == Base::ContentType::Translated)
return;
ReportHighlighter::Paragraph style = ReportHighlighter::LogText;
switch (level) {

View File

@@ -182,7 +182,7 @@ public:
Q_UNUSED(notifiername)
Q_UNUSED(recipient)
Q_UNUSED(content)
#ifdef FC_DEBUG
Log(msg.c_str());
Q_UNUSED(level)