KSystemLog – system log viewer tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
6.2KB

  1. /***************************************************************************
  2. * Copyright (C) 2005 by Nicolas Ternisien *
  3. * nicolas.ternisien@gmail.com *
  4. * *
  5. * This program is free software; you can redistribute it and/or modify *
  6. * it under the terms of the GNU General Public License as published by *
  7. * the Free Software Foundation; either version 2 of the License, or *
  8. * (at your option) any later version. *
  9. * *
  10. * This program is distributed in the hope that it will be useful, *
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  13. * GNU General Public License for more details. *
  14. * *
  15. * You should have received a copy of the GNU General Public License *
  16. * along with this program; if not, write to the *
  17. * Free Software Foundation, Inc., *
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
  19. ***************************************************************************/
  20. #include "globals.h"
  21. #include <tdelocale.h>
  22. #include "logLevel.h"
  23. #include "logMode.h"
  24. //Existing Log levels. The id value corresponds to the index in the vector
  25. LogLevels Globals::logLevels;
  26. LogLevel* Globals::noneLogLevel=NULL;
  27. LogLevel* Globals::debugLogLevel=NULL;
  28. LogLevel* Globals::informationLogLevel=NULL;
  29. LogLevel* Globals::noticeLogLevel=NULL;
  30. LogLevel* Globals::warningLogLevel=NULL;
  31. LogLevel* Globals::errorLogLevel=NULL;
  32. LogLevel* Globals::criticalLogLevel=NULL;
  33. LogLevel* Globals::alertLogLevel=NULL;
  34. LogLevel* Globals::emergencyLogLevel=NULL;
  35. void Globals::setupLogLevels() {
  36. Globals::noneLogLevel=new LogLevel(NONE_LOG_LEVEL_ID, i18n("none"), NONE_LOG_LEVEL_ICON, TQColor(208, 210, 220));
  37. Globals::logLevels.append(Globals::noneLogLevel);
  38. Globals::debugLogLevel=new LogLevel(DEBUG_LOG_LEVEL_ID, i18n("debug"), DEBUG_LOG_LEVEL_ICON, TQColor(156, 157, 165));
  39. Globals::logLevels.append(debugLogLevel);
  40. Globals::informationLogLevel=new LogLevel(INFORMATION_LOG_LEVEL_ID, i18n("information"), INFORMATION_LOG_LEVEL_ICON, TQColor(36, 49, 103) /*TQColor(0, 0, 0)*/);
  41. Globals::logLevels.append(Globals::informationLogLevel);
  42. Globals::noticeLogLevel=new LogLevel(NOTICE_LOG_LEVEL_ID, i18n("notice"), NOTICE_LOG_LEVEL_ICON, TQColor(36, 138, 22));
  43. Globals::logLevels.append(Globals::noticeLogLevel);
  44. Globals::warningLogLevel=new LogLevel(WARNING_LOG_LEVEL_ID, i18n("warning"), WARNING_LOG_LEVEL_ICON, TQColor(238, 144, 21));
  45. Globals::logLevels.append(Globals::warningLogLevel);
  46. Globals::errorLogLevel=new LogLevel(ERROR_LOG_LEVEL_ID, i18n("error"), ERROR_LOG_LEVEL_ICON, TQColor(173, 28, 28));
  47. Globals::logLevels.append(Globals::errorLogLevel);
  48. Globals::criticalLogLevel=new LogLevel(CRITICAL_LOG_LEVEL_ID, i18n("critical"), CRITICAL_LOG_LEVEL_ICON, TQColor(214, 26, 26));
  49. Globals::logLevels.append(criticalLogLevel);
  50. Globals::alertLogLevel=new LogLevel(ALERT_LOG_LEVEL_ID, i18n("alert"), ALERT_LOG_LEVEL_ICON, TQColor(214, 0, 0));
  51. Globals::logLevels.append(alertLogLevel);
  52. Globals::emergencyLogLevel=new LogLevel(EMERGENCY_LOG_LEVEL_ID, i18n("emergency"), EMERGENCY_LOG_LEVEL_ICON, TQColor(255, 0, 0));
  53. Globals::logLevels.append(emergencyLogLevel);
  54. }
  55. LogModes Globals::logModes;
  56. LogMode* Globals::noMode=NULL;
  57. LogMode* Globals::openingMode=NULL;
  58. LogMode* Globals::systemMode=NULL;
  59. LogMode* Globals::kernelMode=NULL;
  60. LogMode* Globals::xorgMode=NULL;
  61. LogMode* Globals::bootMode=NULL;
  62. LogMode* Globals::authenticationMode=NULL;
  63. LogMode* Globals::cronMode=NULL;
  64. LogMode* Globals::daemonMode=NULL;
  65. LogMode* Globals::acpidMode=NULL;
  66. LogMode* Globals::cupsMode=NULL;
  67. LogMode* Globals::cupsAccessMode=NULL;
  68. LogMode* Globals::apacheMode=NULL;
  69. LogMode* Globals::apacheAccessMode=NULL;
  70. LogMode* Globals::mailMode=NULL;
  71. LogMode* Globals::sambaMode=NULL;
  72. void Globals::setupLogModes() {
  73. int i=0;
  74. Globals::noMode=new LogMode(i++, i18n("No Log"), NO_MODE_ICON);
  75. Globals::logModes.append(noMode);
  76. Globals::openingMode=new LogMode(i++, i18n("File Log"), OPENING_MODE_ICON);
  77. Globals::logModes.append(openingMode);
  78. Globals::systemMode=new LogMode(i++, i18n("System Log"), SYSTEM_MODE_ICON);
  79. Globals::logModes.append(systemMode);
  80. Globals::kernelMode=new LogMode(i++, i18n("Kernel Log"), KERNEL_MODE_ICON);
  81. Globals::logModes.append(kernelMode);
  82. Globals::xorgMode=new LogMode(i++, i18n("X.org Log"), XORG_MODE_ICON);
  83. Globals::logModes.append(xorgMode);
  84. Globals::sambaMode=new LogMode(i++, i18n("Samba Log"), SAMBA_MODE_ICON);
  85. Globals::logModes.append(sambaMode);
  86. Globals::bootMode=new LogMode(i++, i18n("Boot Log"), BOOT_MODE_ICON);
  87. Globals::logModes.append(bootMode);
  88. Globals::authenticationMode=new LogMode(i++, i18n("Authentication Log"), AUTHENTICATION_MODE_ICON);
  89. Globals::logModes.append(authenticationMode);
  90. Globals::cronMode=new LogMode(i++, i18n("Planned Tasks Cron Log"), CRON_MODE_ICON);
  91. Globals::logModes.append(cronMode);
  92. Globals::daemonMode=new LogMode(i++, i18n("Daemon Log"), DAEMON_MODE_ICON);
  93. Globals::logModes.append(daemonMode);
  94. Globals::acpidMode=new LogMode(i++, i18n("ACPI Log"), ACPID_MODE_ICON);
  95. Globals::logModes.append(acpidMode);
  96. Globals::cupsMode=new LogMode(i++, i18n("CUPS Log"), CUPS_MODE_ICON);
  97. Globals::logModes.append(cupsMode);
  98. Globals::cupsAccessMode=new LogMode(i++, i18n("CUPS Access Log"), CUPS_ACCESS_MODE_ICON);
  99. Globals::logModes.append(cupsAccessMode);
  100. Globals::apacheMode=new LogMode(i++, i18n("Apache Log"), APACHE_MODE_ICON);
  101. Globals::logModes.append(apacheMode);
  102. Globals::apacheAccessMode=new LogMode(i++, i18n("Apache Access Log"), APACHE_ACCESS_MODE_ICON);
  103. Globals::logModes.append(apacheAccessMode);
  104. Globals::mailMode=new LogMode(i++, i18n("Mail Log"), MAIL_MODE_ICON);
  105. Globals::logModes.append(mailMode);
  106. Globals::sambaMode=new LogMode(i++, i18n("Samba Log"), SAMBA_MODE_ICON);
  107. Globals::logModes.append(sambaMode);
  108. }