/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Log
{
-thread_local LogFunction gthreadLocalLogFunction = NULL;
+thread_local LogFunction gthreadLocalLogFunction = nullptr;
/* Forward declarations */
std::string FormatToString(const char *format, ...);
void UninstallLogFunction()
{
- gthreadLocalLogFunction = NULL;
+ gthreadLocalLogFunction = nullptr;
}
#ifdef DEBUG_ENABLED
Filter* Filter::gRender = Filter::New(Debug::Concise, false, "LOG_RENDER");
Filter* Filter::gResource = Filter::New(Debug::Concise, false, "LOG_RESOURCE");
Filter* Filter::gGLResource = Filter::New(Debug::Concise, false, "LOG_GL_RESOURCE");
-Filter* Filter::gObject = NULL;
+Filter* Filter::gObject = nullptr;
Filter* Filter::gImage = Filter::New(Debug::Concise, false, "LOG_IMAGE");
Filter* Filter::gModel = Filter::New(Debug::Concise, false, "LOG_MODEL");
-Filter* Filter::gNode = NULL;
-Filter* Filter::gElement = NULL;
+Filter* Filter::gNode = nullptr;
+Filter* Filter::gElement = nullptr;
Filter* Filter::gActor = Filter::New(Debug::Concise, false, "LOG_ACTOR");
Filter* Filter::gShader = Filter::New(Debug::Concise, false, "LOG_SHADER");
}
}
+void Filter::SetGlobalLogLevel( LogLevel level )
+{
+ for(FilterIter iter = GetActiveFilters()->begin(); iter != GetActiveFilters()->end(); iter++)
+ {
+ (*iter)->SetLogLevel( level );
+ }
+}
void Filter::Log(LogLevel level, const char* format, ...)
{
if( mTraceEnabled )
{
- char *buffer = NULL;
+ char *buffer = nullptr;
int numChars = asprintf( &buffer, " %-*c %s", mNesting, ':', format );
if( numChars >= 0 ) // No error
{
#endif // DEBUG_ENABLED
-
std::string ArgListToString(const char *format, va_list args)
{
std::string str; // empty string