layout.cpp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /******************************************************************************
  2. *
  3. * package: Log4Qt
  4. * file: layout.cpp
  5. * created: September 2007
  6. * author: Martin Heinrich
  7. *
  8. *
  9. * Copyright 2007 Martin Heinrich
  10. *
  11. * Licensed under the Apache License, Version 2.0 (the "License");
  12. * you may not use this file except in compliance with the License.
  13. * You may obtain a copy of the License at
  14. *
  15. * http://www.apache.org/licenses/LICENSE-2.0
  16. *
  17. * Unless required by applicable law or agreed to in writing, software
  18. * distributed under the License is distributed on an "AS IS" BASIS,
  19. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20. * See the License for the specific language governing permissions and
  21. * limitations under the License.
  22. *
  23. ******************************************************************************/
  24. /******************************************************************************
  25. * Dependencies
  26. ******************************************************************************/
  27. #include "log4qt/layout.h"
  28. #include <QtCore/QDebug>
  29. #include "log4qt/loggingevent.h"
  30. #include "log4qt/logmanager.h"
  31. namespace Log4Qt
  32. {
  33. /***************************************************************************
  34. * Declarations
  35. **************************************************************************/
  36. /**************************************************************************
  37. * C helper functions
  38. **************************************************************************/
  39. /**************************************************************************
  40. * Class implementation: Layout
  41. **************************************************************************/
  42. QString Layout::contentType() const
  43. {
  44. return QString::fromLatin1("text/plain");
  45. }
  46. void Layout::activateOptions()
  47. {
  48. }
  49. QString Layout::endOfLine()
  50. {
  51. // There seams to be no function in Qt for this
  52. #ifdef Q_OS_WIN32
  53. return QLatin1String("\r\n");
  54. #endif // Q_OS_WIN32
  55. //#ifdef Q_OS_MAC
  56. // return QLatin1String("\r");
  57. //#endif // Q_OS_MAC
  58. return QLatin1String("\n");
  59. }
  60. /**************************************************************************
  61. * Implementation: Operators, Helper
  62. **************************************************************************/
  63. } // namespace Log4Qt