Class StackTrace

Synopsis

#include <src/easylogging++.h>

class StackTrace : base::NoCopy

Description

No description yet.

Mentioned in

Inheritance

Ancestors: NoCopy

Classes

StackTraceEntry

Methods

StackTrace
~StackTrace
getLatestStack

Source

Lines 3570-3610 in src/easylogging++.h.

class StackTrace : base::NoCopy {
 public:
  static const unsigned int kMaxStack = 64;
  static const unsigned int kStackStart = 2;  // We want to skip c'tor and StackTrace::generateNew()
  class StackTraceEntry {
   public:
    StackTraceEntry(std::size_t index, const std::string& loc, const std::string& demang, const std::string& hex,
                    const std::string& addr);
    StackTraceEntry(std::size_t index, const std::string& loc) :
      m_index(index),
      m_location(loc) {
    }
    std::size_t m_index;
    std::string m_location;
    std::string m_demangled;
    std::string m_hex;
    std::string m_addr;
    friend std::ostream& operator<<(std::ostream& ss, const StackTraceEntry& si);

   private:
    StackTraceEntry(void);
  };

  StackTrace(void) {
    generateNew();
  }

  virtual ~StackTrace(void) {
  }

  inline std::vector<StackTraceEntry>& getLatestStack(void) {
    return m_stack;
  }

  friend std::ostream& operator<<(std::ostream& os, const StackTrace& st);

 private:
  std::vector<StackTraceEntry> m_stack;

  void generateNew(void);
};





Add Discussion

Log in to comment