@@ -51,12 +51,6 @@ namespace Log {
5151 // The default filtering level
5252 const Level DEFAULT_FILTER_LEVEL = Level::WARNING;
5353
54- extern Cvar::Cvar<bool > logExtendAll;
55- extern Cvar::Cvar<bool > logExtendWarn;
56- extern Cvar::Cvar<bool > logExtendNotice;
57- extern Cvar::Cvar<bool > logExtendVerbose;
58- extern Cvar::Cvar<bool > logExtendDebug;
59-
6054 /*
6155 * Loggers are used to group logs by subsystems and allow logs
6256 * to be filtered by log level by subsystem. They are used like so
@@ -116,7 +110,8 @@ namespace Log {
116110 Logger WithoutSuppression ();
117111
118112 private:
119- void Dispatch (std::string message, Log::Level level, Str::StringRef format);
113+ void Dispatch (std::string message, Log::Level level, Str::StringRef format,
114+ const char * file, const char * function, int line);
120115
121116 std::string Prefix (Str::StringRef message) const ;
122117
@@ -203,62 +198,35 @@ namespace Log {
203198
204199 // Logger
205200
206- inline std::string AddSrcLocation ( const std::string& message,
207- const char * file, const char * function, const int line,
208- const bool extend ) {
209- if ( logExtendAll.Get () || extend ) {
210- return message + Str::Format ( " ^F(%s:%u, %s)" ,
211- file, line, function );
212- }
213-
214- return message;
215- }
216-
217201 template <typename ... Args>
218202 void Logger::WarnExt ( const char * file, const char * function, const int line, Str::StringRef format, Args&& ... args ) {
219203 if ( filterLevel->Get () <= Level::WARNING ) {
220- this ->Dispatch (
221- AddSrcLocation (
222- Prefix ( Str::Format ( format, std::forward<Args>( args ) ... ) ),
223- file, function, line, logExtendWarn.Get ()
224- ),
225- Level::WARNING, format );
204+ this ->Dispatch (Prefix (Str::Format (format, std::forward<Args>(args)...)),
205+ Level::WARNING, format, file, function, line);
226206 }
227207 }
228208
229209 template <typename ... Args>
230210 void Logger::NoticeExt ( const char * file, const char * function, const int line, Str::StringRef format, Args&& ... args ) {
231211 if ( filterLevel->Get () <= Level::NOTICE ) {
232- this ->Dispatch (
233- AddSrcLocation (
234- Prefix ( Str::Format ( format, std::forward<Args>( args ) ... ) ),
235- file, function, line, logExtendNotice.Get ()
236- ),
237- Level::NOTICE, format );
212+ this ->Dispatch (Prefix (Str::Format (format, std::forward<Args>(args)...)),
213+ Level::NOTICE, format, file, function, line);
238214 }
239215 }
240216
241217 template <typename ... Args>
242218 void Logger::VerboseExt ( const char * file, const char * function, const int line, Str::StringRef format, Args&& ... args ) {
243219 if ( filterLevel->Get () <= Level::VERBOSE ) {
244- this ->Dispatch (
245- AddSrcLocation (
246- Prefix ( Str::Format ( format, std::forward<Args>( args ) ... ) ),
247- file, function, line, logExtendVerbose.Get ()
248- ),
249- Level::VERBOSE, format );
220+ this ->Dispatch (Prefix (Str::Format (format, std::forward<Args>(args)...)),
221+ Level::VERBOSE, format, file, function, line);
250222 }
251223 }
252224
253225 template <typename ... Args>
254226 void Logger::DebugExt ( const char * file, const char * function, const int line, Str::StringRef format, Args&& ... args ) {
255227 if ( filterLevel->Get () <= Level::DEBUG ) {
256- this ->Dispatch (
257- AddSrcLocation (
258- Prefix ( Str::Format ( format, std::forward<Args>( args ) ... ) ),
259- file, function, line, logExtendDebug.Get ()
260- ),
261- Level::DEBUG, format );
228+ this ->Dispatch (Prefix (Str::Format (format, std::forward<Args>(args)...)),
229+ Level::DEBUG, format, file, function, line);
262230 }
263231 }
264232
0 commit comments