/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
#include "test-trace-call-stack.h"
+#include <iostream>
#include <sstream>
namespace Dali
/**
* Constructor
*/
-TraceCallStack::TraceCallStack()
-: mTraceActive(false)
+TraceCallStack::TraceCallStack(std::string prefix)
+: mTraceActive(false),
+ mPrefix(prefix)
{
}
return mTraceActive;
}
+void TraceCallStack::EnableLogging(bool enablelogging)
+{
+ mLogging = enablelogging;
+}
+
/**
* Push a call onto the stack if the trace is active
* @param[in] method The name of the method
FunctionCall stackFrame(method, params);
mCallStack.push_back(stackFrame);
}
+ if(mLogging)
+ {
+ fprintf(stderr, "%s%s(%s)\n", mPrefix.c_str(), method.c_str(), params.c_str());
+ }
}
void TraceCallStack::PushCall(std::string method, std::string params, const TraceCallStack::NamedParams& altParams)
FunctionCall stackFrame(method, params, altParams);
mCallStack.push_back(stackFrame);
}
+ if(mLogging)
+ {
+ fprintf(stderr, "%s%s(%s)\n", mPrefix.c_str(), method.c_str(), params.c_str());
+ }
}
/**
break;
}
}
+ if(!found)
+ {
+ fprintf(stderr, "Search for %s failed\n", method.c_str());
+ }
return found;
}
break;
}
}
+ if(!found)
+ {
+ fprintf(stderr, "Search for %s(%s) failed\n", method.c_str(), params.c_str());
+ }
return found;
}