@@ -127,48 +127,49 @@ namespace BCLog {
127
127
std::string GetLogPrefix (LogFlags category, Level level) const ;
128
128
129
129
/* * Send a string to the log output */
130
- void LogPrintStr (const std::string& str, const std::string& logging_function, const std::string& source_file, int source_line, BCLog::LogFlags category, BCLog::Level level);
130
+ void LogPrintStr (const std::string& str, const std::string& logging_function, const std::string& source_file, int source_line, BCLog::LogFlags category, BCLog::Level level)
131
+ EXCLUSIVE_LOCKS_REQUIRED(!m_cs);
131
132
132
133
/* * Returns whether logs will be written to any output */
133
- bool Enabled () const
134
+ bool Enabled () const EXCLUSIVE_LOCKS_REQUIRED(!m_cs)
134
135
{
135
136
StdLockGuard scoped_lock (m_cs);
136
137
return m_buffering || m_print_to_console || m_print_to_file || !m_print_callbacks.empty ();
137
138
}
138
139
139
140
/* * Connect a slot to the print signal and return the connection */
140
- std::list<std::function<void (const std::string&)>>::iterator PushBackCallback (std::function<void (const std::string&)> fun)
141
+ std::list<std::function<void (const std::string&)>>::iterator PushBackCallback (std::function<void (const std::string&)> fun) EXCLUSIVE_LOCKS_REQUIRED(!m_cs)
141
142
{
142
143
StdLockGuard scoped_lock (m_cs);
143
144
m_print_callbacks.push_back (std::move (fun));
144
145
return --m_print_callbacks.end ();
145
146
}
146
147
147
148
/* * Delete a connection */
148
- void DeleteCallback (std::list<std::function<void (const std::string&)>>::iterator it)
149
+ void DeleteCallback (std::list<std::function<void (const std::string&)>>::iterator it) EXCLUSIVE_LOCKS_REQUIRED(!m_cs)
149
150
{
150
151
StdLockGuard scoped_lock (m_cs);
151
152
m_print_callbacks.erase (it);
152
153
}
153
154
154
155
/* * Start logging (and flush all buffered messages) */
155
- bool StartLogging ();
156
+ bool StartLogging () EXCLUSIVE_LOCKS_REQUIRED(!m_cs) ;
156
157
/* * Only for testing */
157
- void DisconnectTestLogger ();
158
+ void DisconnectTestLogger () EXCLUSIVE_LOCKS_REQUIRED(!m_cs) ;
158
159
159
160
void ShrinkDebugFile ();
160
161
161
- std::unordered_map<LogFlags, Level> CategoryLevels () const
162
+ std::unordered_map<LogFlags, Level> CategoryLevels () const EXCLUSIVE_LOCKS_REQUIRED(!m_cs)
162
163
{
163
164
StdLockGuard scoped_lock (m_cs);
164
165
return m_category_log_levels;
165
166
}
166
- void SetCategoryLogLevel (const std::unordered_map<LogFlags, Level>& levels)
167
+ void SetCategoryLogLevel (const std::unordered_map<LogFlags, Level>& levels) EXCLUSIVE_LOCKS_REQUIRED(!m_cs)
167
168
{
168
169
StdLockGuard scoped_lock (m_cs);
169
170
m_category_log_levels = levels;
170
171
}
171
- bool SetCategoryLogLevel (const std::string& category_str, const std::string& level_str);
172
+ bool SetCategoryLogLevel (const std::string& category_str, const std::string& level_str) EXCLUSIVE_LOCKS_REQUIRED(!m_cs) ;
172
173
173
174
Level LogLevel () const { return m_log_level.load (); }
174
175
void SetLogLevel (Level level) { m_log_level = level; }
@@ -182,7 +183,7 @@ namespace BCLog {
182
183
bool DisableCategory (const std::string& str);
183
184
184
185
bool WillLogCategory (LogFlags category) const ;
185
- bool WillLogCategoryLevel (LogFlags category, Level level) const ;
186
+ bool WillLogCategoryLevel (LogFlags category, Level level) const EXCLUSIVE_LOCKS_REQUIRED(!m_cs) ;
186
187
187
188
/* * Returns a vector of the log categories in alphabetical order. */
188
189
std::vector<LogCategory> LogCategoriesList () const ;
0 commit comments