UNPKG

1.84 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../src/logger.js"],"names":["log","require","DEFAULT_NAME_SPACE","logger","getLogger","setLevel","levels","DEBUG","module","exports"],"mappings":";;AAAA;;;;;;;;;;;;;;;;AAgBA;;;AAGA,IAAMA,MAAMC,QAAQ,UAAR,CAAZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,qBAAqB,QAA3B;AACA,IAAMC,SAASH,IAAII,SAAJ,CAAcF,kBAAd,CAAf;AACAC,OAAOE,QAAP,CAAgBL,IAAIM,MAAJ,CAAWC,KAA3B;;AAEA;;;;AAIAC,OAAOC,OAAP,GAAiBN,MAAjB","file":"logger.js","sourcesContent":["/*\nCopyright 2018 André Jaenisch\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n/**\n * @module logger\n */\nconst log = require(\"loglevel\");\n\n// This is to demonstrate, that you can use any namespace you want.\n// Namespaces allow you to turn on/off the logging for specific parts of the\n// application.\n// An idea would be to control this via an environment variable (on Node.js).\n// See https://www.npmjs.com/package/debug to see how this could be implemented\n// Part of #332 is introducing a logging library in the first place.\nconst DEFAULT_NAME_SPACE = \"matrix\";\nconst logger = log.getLogger(DEFAULT_NAME_SPACE);\nlogger.setLevel(log.levels.DEBUG);\n\n/**\n * Drop-in replacement for <code>console</code> using {@link https://www.npmjs.com/package/loglevel|loglevel}.\n * Can be tailored down to specific use cases if needed.\n*/\nmodule.exports = logger;\n"]}
\No newline at end of file