logging.scm 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
  3. ;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
  4. ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
  5. ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
  6. ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  7. ;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
  8. ;;; Copyright © 2019 Meiyo Peng <meiyo@riseup.net>
  9. ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
  10. ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
  11. ;;;
  12. ;;; This file is part of GNU Guix.
  13. ;;;
  14. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  15. ;;; under the terms of the GNU General Public License as published by
  16. ;;; the Free Software Foundation; either version 3 of the License, or (at
  17. ;;; your option) any later version.
  18. ;;;
  19. ;;; GNU Guix is distributed in the hope that it will be useful, but
  20. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. ;;; GNU General Public License for more details.
  23. ;;;
  24. ;;; You should have received a copy of the GNU General Public License
  25. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  26. (define-module (gnu packages logging)
  27. #:use-module ((guix licenses) #:prefix license:)
  28. #:use-module (guix packages)
  29. #:use-module (guix utils)
  30. #:use-module (guix download)
  31. #:use-module (guix git-download)
  32. #:use-module (guix build-system cmake)
  33. #:use-module (guix build-system gnu)
  34. #:use-module (guix build-system python)
  35. #:use-module (gnu packages)
  36. #:use-module (gnu packages ncurses)
  37. #:use-module (gnu packages perl)
  38. #:use-module (gnu packages python)
  39. #:use-module (gnu packages python-web)
  40. #:use-module (gnu packages python-xyz)
  41. #:use-module (gnu packages autotools))
  42. (define-public log4cpp
  43. (package
  44. (name "log4cpp")
  45. (version "1.1.3")
  46. (source (origin
  47. (method url-fetch)
  48. (uri (string-append "mirror://sourceforge/log4cpp/log4cpp-"
  49. (version-major+minor version) ".x%20%28new%29"
  50. "/log4cpp-" (version-major+minor version)
  51. "/log4cpp-" version ".tar.gz"))
  52. (sha256
  53. (base32
  54. "07gmr3jyaf2239n9sp6h7hwdz1pv7b7aka8n06gmr2fnlmaymfrc"))))
  55. (build-system gnu-build-system)
  56. (arguments
  57. '(#:phases
  58. (modify-phases %standard-phases
  59. (add-after 'unpack 'do-not-call-stime
  60. (lambda _
  61. ;; Patch out use of 'stime' which was removed from glibc 2.31.
  62. ;; The test would not work in the build container anyway.
  63. (substitute* "tests/testDailyRollingFileAppender.cpp"
  64. (("if \\(stime\\(&now\\) == -1\\)")
  65. "if (1)"))
  66. #t)))))
  67. (synopsis "Log library for C++")
  68. (description
  69. "Log4cpp is library of C++ classes for flexible logging to files, syslog,
  70. IDSA and other destinations. It is modeled after the Log4j Java library,
  71. staying as close to their API as is reasonable.")
  72. (home-page "http://log4cpp.sourceforge.net/")
  73. (license license:lgpl2.1+)))
  74. (define-public glog
  75. (package
  76. (name "glog")
  77. (version "0.5.0")
  78. (home-page "https://github.com/google/glog")
  79. (source (origin
  80. (method git-fetch)
  81. (uri (git-reference (url home-page)
  82. (commit (string-append "v" version))))
  83. (sha256
  84. (base32
  85. "17014q25c99qyis6l3fwxidw6222bb269fdlr74gn7pzmzg4lvg3"))
  86. (file-name (git-file-name name version))))
  87. (build-system cmake-build-system)
  88. (native-inputs
  89. `(("perl" ,perl) ;for tests
  90. ("autoconf" ,autoconf)
  91. ("automake" ,automake)
  92. ("libtool" ,libtool)))
  93. (synopsis "C++ logging library")
  94. (description
  95. "Google glog is a library that implements application-level logging.
  96. This library provides logging APIs based on C++-style streams and various
  97. helper macros. You can log a message by simply streaming things to log at a
  98. particular severity level. It allows logging to be controlled from the
  99. command line.")
  100. (license license:bsd-3)))
  101. (define-public tailon
  102. (package
  103. (name "tailon")
  104. (version "1.3.0")
  105. (source
  106. (origin
  107. (method url-fetch)
  108. (uri (pypi-uri name version))
  109. (sha256
  110. (base32
  111. "0wl2wm6p3pc0vkk33s7rzgcfvs9cwxfmlz997pdfhlw72r00l7s5"))))
  112. (build-system python-build-system)
  113. (inputs
  114. `(("python-pyyaml" ,python-pyyaml)
  115. ("python-sockjs-tornado" ,python-sockjs-tornado)
  116. ("python-tornado-http-auth" ,python-tornado-http-auth)
  117. ("python-tornado" ,python-tornado)))
  118. (arguments
  119. `(#:phases
  120. (modify-phases %standard-phases
  121. (add-after 'unpack 'patch-commands.py
  122. (lambda args
  123. (substitute* "tailon/commands.py"
  124. (("self\\.first_in_path\\('grep'\\)")
  125. (string-append"'" (which "grep") "'"))
  126. (("self\\.first_in_path\\('gawk', 'awk'\\)")
  127. (string-append"'" (which "gawk") "'"))
  128. (("self\\.first_in_path\\('gsed', 'sed'\\)")
  129. (string-append"'" (which "sed") "'"))
  130. (("self\\.first_in_path\\('gtail', 'tail'\\)")
  131. (string-append"'" (which "tail") "'")))
  132. #t)))))
  133. (home-page "https://tailon.readthedocs.io/")
  134. (synopsis
  135. "Webapp for looking at and searching through log files")
  136. (description
  137. "Tailon provides a web interface around the tail, grep, awk and sed
  138. commands, displaying the results via a web interface.")
  139. (license license:bsd-3)))
  140. (define-public multitail
  141. (package
  142. (name "multitail")
  143. (version "6.5.0")
  144. (source
  145. (origin
  146. (method url-fetch)
  147. (uri (string-append "https://vanheusden.com/multitail/multitail-"
  148. version ".tgz"))
  149. (sha256
  150. (base32 "1vd9vdxyxsccl64ilx542ya5vlw2bpg6gnkq1x8cfqy6vxvmx7dj"))))
  151. (build-system gnu-build-system)
  152. (arguments
  153. `(#:make-flags
  154. (list (string-append "CC=" ,(cc-for-target))
  155. (string-append "PREFIX="
  156. (assoc-ref %outputs "out")))
  157. #:phases
  158. (modify-phases %standard-phases
  159. (add-after 'unpack 'patch-curses-lib
  160. (lambda* (#:key outputs #:allow-other-keys)
  161. (let ((out (assoc-ref outputs "out")))
  162. (substitute* "mt.h"
  163. (("ncursesw\\/panel.h") "panel.h")
  164. (("ncursesw\\/ncurses.h") "ncurses.h")))
  165. #t))
  166. (delete 'configure)) ; no configure script
  167. #:tests? #f)) ; no test suite (make check just runs cppcheck)
  168. (inputs `(("ncurses" ,ncurses)))
  169. (home-page "https://vanheusden.com/multitail/")
  170. (synopsis "Monitor multiple log files")
  171. (description
  172. "MultiTail can monitor, color, filter, and merge log files and command
  173. output in multiple windows in a terminal.")
  174. (license license:gpl2+)))
  175. (define-public spdlog
  176. (package
  177. (name "spdlog")
  178. (version "1.8.5")
  179. (source
  180. (origin
  181. (method git-fetch)
  182. (uri (git-reference
  183. (url "https://github.com/gabime/spdlog")
  184. (commit (string-append "v" version))))
  185. (file-name (git-file-name name version))
  186. (sha256
  187. (base32 "179krvg5sad6dviqpcjwg6czzknnilqszrg1d0fgp12h6sy66vqg"))))
  188. (build-system cmake-build-system)
  189. ;; TODO run benchmark. Currently not possible, as adding
  190. ;; (gnu packages benchmark) forms a dependency cycle
  191. (arguments
  192. '(#:configure-flags
  193. (list "-DSPDLOG_BUILD_BENCH=OFF"
  194. "-DSPDLOG_BUILD_TESTS=ON")))
  195. (home-page "https://github.com/gabime/spdlog")
  196. (synopsis "Fast C++ logging library")
  197. (description "Spdlog is a very fast header-only/compiled C++ logging
  198. library.")
  199. ;; spdlog is under Expat license, but the bundled fmt library in
  200. ;; "include/spdlog/fmt/bundled" is under BSD 2 clause license.
  201. (license (list license:expat license:bsd-2))))