Commit f8f7ceb6 authored by williangaspar's avatar williangaspar

print message once

parent 840712bc
......@@ -10,6 +10,8 @@
namespace bpftrace {
namespace ast {
static bool PRINT_STACK_DEPRICATED = true;
class Visitor;
class Node {
......@@ -59,8 +61,12 @@ class Builtin : public Expression {
public:
explicit Builtin(std::string ident) : ident(ident) {
if (ident == "stack") {
std::cout << "\033[33mwarning: \033[0m";
std::cout << "stack is deprecated and will be removed in the future. Use kstack instead" << std::endl;
if (PRINT_STACK_DEPRICATED)
{
std::cerr << "warning: stack is deprecated and will be removed in the future. Use kstack instead" << std::endl;
PRINT_STACK_DEPRICATED = false;
}
this->ident = "kstack";
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment