UNPKG

1.38 kBJavaScriptView Raw
1"use strict";
2
3/*
4Copyright 2018 André Jaenisch
5
6Licensed under the Apache License, Version 2.0 (the "License");
7you may not use this file except in compliance with the License.
8You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing, software
13distributed under the License is distributed on an "AS IS" BASIS,
14WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15See the License for the specific language governing permissions and
16limitations under the License.
17*/
18
19/**
20 * @module logger
21 */
22var log = require("loglevel");
23
24// This is to demonstrate, that you can use any namespace you want.
25// Namespaces allow you to turn on/off the logging for specific parts of the
26// application.
27// An idea would be to control this via an environment variable (on Node.js).
28// See https://www.npmjs.com/package/debug to see how this could be implemented
29// Part of #332 is introducing a logging library in the first place.
30var DEFAULT_NAME_SPACE = "matrix";
31var logger = log.getLogger(DEFAULT_NAME_SPACE);
32logger.setLevel(log.levels.DEBUG);
33
34/**
35 * Drop-in replacement for <code>console</code> using {@link https://www.npmjs.com/package/loglevel|loglevel}.
36 * Can be tailored down to specific use cases if needed.
37*/
38module.exports = logger;
39//# sourceMappingURL=logger.js.map
\No newline at end of file