log.h 981 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include <string>
  3. #include <deque>
  4. #include <sstream>
  5. #include <pushNotification/pushNotification.h>
  6. namespace pika
  7. {
  8. struct LogManager
  9. {
  10. static constexpr const char *DefaultLogFile = PIKA_RESOURCES_PATH "logs.txt";
  11. //a null name will just log to a internal structure
  12. void init(std::string name);
  13. //this will be dependent on the configuration of the project.
  14. void log(const char *l, int type = pika::logNormal);
  15. std::string name = "";
  16. bool firstLog = 0;
  17. std::deque<std::string> internalLogs;
  18. static constexpr int maxInternalLogCount = 200;
  19. pika::PushNotificationManager *pushNotificationManager = 0;
  20. private:
  21. //used only interally.
  22. void logToFile(const char *l, int type = pika::logNormal);
  23. void logInternally(const char *l, int type = pika::logNormal);
  24. void logToPushNotification(const char *l, int type = pika::logNormal);
  25. };
  26. void logToFile(const char *fileName, const char *l, int type = pika::logNormal);
  27. }