gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / logging.scm
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 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
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
43 (define-public log4cpp
44 (package
45 (name "log4cpp")
46 (version "1.1.3")
47 (source (origin
48 (method url-fetch)
49 (uri (string-append "mirror://sourceforge/log4cpp/log4cpp-"
50 (version-major+minor version) ".x%20%28new%29"
51 "/log4cpp-" (version-major+minor version)
52 "/log4cpp-" version ".tar.gz"))
53 (sha256
54 (base32
55 "07gmr3jyaf2239n9sp6h7hwdz1pv7b7aka8n06gmr2fnlmaymfrc"))))
56 (build-system gnu-build-system)
57 (arguments
58 '(#:phases
59 (modify-phases %standard-phases
60 (add-after 'unpack 'do-not-call-stime
61 (lambda _
62 ;; Patch out use of 'stime' which was removed from glibc 2.31.
63 ;; The test would not work in the build container anyway.
64 (substitute* "tests/testDailyRollingFileAppender.cpp"
65 (("if \\(stime\\(&now\\) == -1\\)")
66 "if (1)"))
67 #t)))))
68 (synopsis "Log library for C++")
69 (description
70 "Log4cpp is library of C++ classes for flexible logging to files, syslog,
71 IDSA and other destinations. It is modeled after the Log4j Java library,
72 staying as close to their API as is reasonable.")
73 (home-page "http://log4cpp.sourceforge.net/")
74 (license license:lgpl2.1+)))
75
76 (define-public glog
77 (package
78 (name "glog")
79 (version "0.4.0")
80 (home-page "https://github.com/google/glog")
81 (source (origin
82 (method git-fetch)
83 (uri (git-reference (url home-page)
84 (commit (string-append "v" version))))
85 (sha256
86 (base32
87 "1xd3maiipfbxmhc9rrblc5x52nxvkwxp14npg31y5njqvkvzax9b"))
88 (file-name (git-file-name name version))))
89 (build-system gnu-build-system)
90 (arguments
91 `(#:phases (modify-phases %standard-phases
92 (add-before 'check 'disable-signal-tests
93 (lambda _
94 ;; XXX: This test fails on non x86_64. See e.g.
95 ;; https://github.com/google/glog/issues/219 and
96 ;; https://github.com/google/glog/issues/256.
97 (substitute* "Makefile"
98 (("\tsignalhandler_unittest_sh") "\t$(EMPTY)"))
99 #t)))))
100 (native-inputs
101 `(("perl" ,perl) ;for tests
102 ("autoconf" ,autoconf)
103 ("automake" ,automake)
104 ("libtool" ,libtool)))
105 (synopsis "C++ logging library")
106 (description
107 "Google glog is a library that implements application-level logging.
108 This library provides logging APIs based on C++-style streams and various
109 helper macros. You can log a message by simply streaming things to log at a
110 particular severity level. It allows logging to be controlled from the
111 command line.")
112 (license license:bsd-3)))
113
114 (define-public tailon
115 (package
116 (name "tailon")
117 (version "1.3.0")
118 (source
119 (origin
120 (method url-fetch)
121 (uri (pypi-uri name version))
122 (sha256
123 (base32
124 "0wl2wm6p3pc0vkk33s7rzgcfvs9cwxfmlz997pdfhlw72r00l7s5"))))
125 (build-system python-build-system)
126 (inputs
127 `(("python-pyyaml" ,python-pyyaml)
128 ("python-sockjs-tornado" ,python-sockjs-tornado)
129 ("python-tornado-http-auth" ,python-tornado-http-auth)
130 ("python-tornado" ,python-tornado)))
131 (arguments
132 `(#:phases
133 (modify-phases %standard-phases
134 (add-after 'unpack 'patch-commands.py
135 (lambda args
136 (substitute* "tailon/commands.py"
137 (("self\\.first_in_path\\('grep'\\)")
138 (string-append"'" (which "grep") "'"))
139 (("self\\.first_in_path\\('gawk', 'awk'\\)")
140 (string-append"'" (which "gawk") "'"))
141 (("self\\.first_in_path\\('gsed', 'sed'\\)")
142 (string-append"'" (which "sed") "'"))
143 (("self\\.first_in_path\\('gtail', 'tail'\\)")
144 (string-append"'" (which "tail") "'")))
145 #t)))))
146 (home-page "https://tailon.readthedocs.io/")
147 (synopsis
148 "Webapp for looking at and searching through log files")
149 (description
150 "Tailon provides a web interface around the tail, grep, awk and sed
151 commands, displaying the results via a web interface.")
152 (license license:bsd-3)))
153
154 (define-public multitail
155 (package
156 (name "multitail")
157 (version "6.5.0")
158 (source
159 (origin
160 (method url-fetch)
161 (uri (string-append "https://vanheusden.com/multitail/multitail-"
162 version ".tgz"))
163 (sha256
164 (base32 "1vd9vdxyxsccl64ilx542ya5vlw2bpg6gnkq1x8cfqy6vxvmx7dj"))))
165 (build-system gnu-build-system)
166 (arguments
167 `(#:make-flags
168 (list (string-append "CC=" ,(cc-for-target))
169 (string-append "PREFIX="
170 (assoc-ref %outputs "out")))
171 #:phases
172 (modify-phases %standard-phases
173 (add-after 'unpack 'patch-curses-lib
174 (lambda* (#:key outputs #:allow-other-keys)
175 (let ((out (assoc-ref outputs "out")))
176 (substitute* "mt.h"
177 (("ncursesw\\/panel.h") "panel.h")
178 (("ncursesw\\/ncurses.h") "ncurses.h")))
179 #t))
180 (delete 'configure)) ; no configure script
181 #:tests? #f)) ; no test suite (make check just runs cppcheck)
182 (inputs `(("ncurses" ,ncurses)))
183 (home-page "https://vanheusden.com/multitail/")
184 (synopsis "Monitor multiple log files")
185 (description
186 "MultiTail can monitor, color, filter, and merge log files and command
187 output in multiple windows in a terminal.")
188 (license license:gpl2+)))
189
190 (define-public spdlog
191 (package
192 (name "spdlog")
193 (version "1.8.5")
194 (source
195 (origin
196 (method git-fetch)
197 (uri (git-reference
198 (url "https://github.com/gabime/spdlog")
199 (commit (string-append "v" version))))
200 (file-name (git-file-name name version))
201 (sha256
202 (base32 "179krvg5sad6dviqpcjwg6czzknnilqszrg1d0fgp12h6sy66vqg"))))
203 (build-system cmake-build-system)
204 ;; TODO run benchmark. Currently not possible, as adding
205 ;; (gnu packages benchmark) forms a dependency cycle
206 (arguments
207 '(#:configure-flags
208 (list "-DSPDLOG_BUILD_BENCH=OFF"
209 "-DSPDLOG_BUILD_TESTS=ON")))
210 (home-page "https://github.com/gabime/spdlog")
211 (synopsis "Fast C++ logging library")
212 (description "Spdlog is a very fast header-only/compiled C++ logging
213 library.")
214 ;; spdlog is under Expat license, but the bundled fmt library in
215 ;; "include/spdlog/fmt/bundled" is under BSD 2 clause license.
216 (license (list license:expat license:bsd-2))))