Skip to content

Commit 7260c0f

Browse files
author
NarrowsProjects
committed
feat: create infoLoggerListener
1 parent cc21b68 commit 7260c0f

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* @license
3+
* Copyright CERN and copyright holders of ALICE O2. This software is
4+
* distributed under the terms of the GNU General Public License v3 (GPL
5+
* Version 3), copied verbatim in the file "COPYING".
6+
*
7+
* See http://alice-o2.web.cern.ch/license for full licensing information.
8+
*
9+
* In applying this license CERN does not waive the privileges and immunities
10+
* granted to it by virtue of its status as an Intergovernmental Organization
11+
* or submit itself to any jurisdiction.
12+
*/
13+
14+
/**
15+
* Logger based middleware generator
16+
*
17+
* @param {Class} logger class that exposes an infoMessage function that recceives the request and then sends specific data to InfoLogger
18+
* @return {(function(*, *, *): void)} the infoLoggerListener middleware
19+
*/
20+
exports.infoLoggerListenerMiddleware = (logger) => (request, _response, next) => {
21+
logger.infoMessage(request);
22+
next();
23+
};

0 commit comments

Comments
 (0)