24 template<>
LogManager* Mgr<LogManager>::instance =
nullptr;
37 if (
log != &g_null_log)
49 if (
log != &g_null_log)
63 for (
size_t i = 0; i < max_logs; ++i)
72 slot[stdout_log].title =
_T(
"stdout");
73 slot[app_log].title =
_T(
"Code::Blocks");
74 slot[debug_log].title =
_T(
"Code::Blocks Debug");
83 wxT(
"logs_critical_text_listctrl"),
wxColour(0x0a, 0x00, 0x00));
94 for (inst_map_t::iterator i = instMap.begin(); i != instMap.end(); ++i)
100 if (i >= 0 && i <= max_logs && slot[i].
log != &g_null_log)
101 slot[i].log->Clear();
106 if (i >= 0 && i <= max_logs && slot[i].
log != &g_null_log)
107 slot[i].log->Append(msg, lv);
112 unsigned int index = i;
116 for (index = debug_log + 1; index < max_logs; ++
index)
118 if (slot[index].
GetLogger() == &g_null_log)
120 slot[
index].SetLogger(l);
129 slot[
index].SetLogger(l);
135 for (
size_t i = 0; i < max_logs; ++i)
138 slot[i].log->UpdateSettings();
144 SetLog(&g_null_log, i);
154 for (
unsigned int i = invalid_log; i < max_logs; ++i)
156 if (slot[i].
log == l)
166 for (inst_map_t::iterator i = instMap.begin(); i != instMap.end(); ++i)
174 inst_map_t::iterator i = instMap.find(name);
176 if (i != instMap.end())
177 return i->second->RequiresFilename();
184 inst_map_t::iterator i;
186 if ((i = instMap.find(name)) != instMap.end())
187 return i->second->New();
void wxSafeShowMessage(const wxString &title, const wxString &text)
void Register(const wxString &name, InstantiatorBase *ins)
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
void RegisterColour(const wxString &category, const wxString &name, const wxString &id, const wxColour &defaultColour)
a logger simply does nothing
size_t FindIndex(Logger *l)
The base class for all kinds of loggers, see loggers.h for its derived classes.
wxArrayString ListAvailable()
void Panic(const wxString &msg, const wxString &component=wxEmptyString)
static NullLogger g_null_log
a logger which prints messages to the standard console IO
const wxString & _(const wxString &string)
void SetLogger(Logger *in)
ColourManager * GetColourManager() const
wxString & Append(const char *psz)
Logger * GetLogger() const
bool FilenameRequired(const wxString &name)
size_t Add(const wxString &str, size_t copies=1)
void LogInternal(const wxString &msg, int i, Logger::level lv)
Logger * New(const wxString &name)
size_t SetLog(Logger *l, int index=no_index)
void ClearLogInternal(int i)