{"_id":"@auturge/logger","_rev":"4-e9d3cc8f1e23f5876895db69a0a72faa","name":"@auturge/logger","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@auturge/logger","description":"A handy multiplexing logger.","version":"1.0.0","author":{"name":"auturge"},"license":"MIT","bugs":{"url":"https://github.com/auturge/logger/issues"},"homepage":"https://github.com/auturge/logger","repository":{"type":"git","url":"git+https://github.com/auturge/logger.git"},"engines":{"node":">=12.8.1"},"main":"logger.js","module":"logger.es6.js","browser":"logger.umd.js","dependencies":{"tslib":"2.1.0","colorette":"1.2.2","date-fns":"2.21.1","date-fns-tz":"1.1.4"},"_id":"@auturge/logger@1.0.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-vuGcliGTjHl+4+yDaWgqU0wJdTcyJnQ2Oxg7lGKn6Z3gf238gIaUDzIMQHPoc6xnBbGA4lWnpRd9Y6WHWYXkpA==","shasum":"475881899891221b34705943f7dd4ca52dd7dad3","tarball":"https://registry.npmjs.org/@auturge/logger/-/logger-1.0.0.tgz","fileCount":13,"unpackedSize":1009917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmILNCRA9TVsSAnZWagAAl+cP/3hU7TlxAeEzQNu7ei+H\nTRkz425QzsROtnBr/CiSfXav6jouYK3Yc3ZA1TKpeaBK9LwDpCRoGCbMdaAP\njPAiZfb+BpVnkbbysk3DpQWD+ag5LKjJ5z5TU4ClTNPK6+oVOlxgZza9VoqR\nM9O8LJLu3fO+GtEfFQ/2BS/UqHuvYzvRjUMEWvY4PKZEMQ9vzQAyLBp46s4w\nMU5U2wO4hZyv0xAiPgz/HscNeeMiUOguEmKkD1MGpne3Uyw4BJDgPX+AAubu\n6nAGX8XRa6aS+tT1o3rv0h5QISz16AoMYWH2zqCsmEKgMj1zwJWKL8v3D0W2\nmYgYuEZiQpS124HGRchO2Mpz++d2Wmv3F/tqPlXiIgQOwJWpsSyMwzAdKpVA\nsOGgw3RVhHCq7pPcDUoJA9pOAoMMHBz0npaep3kclhXS9XzkycL2oweD44AO\nm+NEdl0d7oca9J8EHHKBqXJJm0FRIVqGZ2GuEHSSapTvL+2/3Koei54HRivk\nHty1nKU9yZcRl++AW+RAzb0LqlH7nbvFZINWoyCGKR2LKxvXH4e4BX5vMq6G\ntMQlGaG4ENbfMdErcUlZ1v2kcUeA+Ce58wSlZCB1BqwIKIBhAS033igNjUBa\nN40+5xrlSySfZbNxbjad+y55PEv48KJEGdBzE6wkwsaGSSyGIacPNvbWWuIm\nDa6U\r\n=4Vc5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCD/Z0k8KDKnDdEb2JZmxOMM2p4Ph6n6l0jjJo+mRnwNAIhAKS5FDhwoZebM6Xe+rTmoWupjaIm+ZDTigVIuZQ6yAc0"}]},"_npmUser":{"name":"curtis.kaler","email":"curt.kaler@gmail.com"},"directories":{},"maintainers":[{"name":"curtis.kaler","email":"curt.kaler@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logger_1.0.0_1620607693046_0.23492279482861256"},"_hasShrinkwrap":false},"1.0.1":{"name":"@auturge/logger","description":"A handy multiplexing logger.","version":"1.0.1","author":{"name":"auturge"},"license":"MIT","bugs":{"url":"https://github.com/auturge/logger/issues"},"homepage":"https://github.com/auturge/logger","repository":{"type":"git","url":"git+https://github.com/auturge/logger.git"},"engines":{"node":">=12.8.1"},"main":"logger.js","module":"logger.es6.js","browser":"logger.umd.js","devDependencies":{"@auturge/json-trim":"1.0.0","@auturge/testing":"1.0.0","@rollup/plugin-commonjs":"18.0.0","@rollup/plugin-node-resolve":"11.2.1","@types/chai":"4.2.15","@types/mocha":"8.2.2","@types/sinon":"9.0.11","@typescript-eslint/eslint-plugin":"4.20.0","@typescript-eslint/parser":"4.20.0","@wessberg/rollup-plugin-ts":"1.3.11","awesome-typescript-loader":"5.2.1","chai":"^4.3.0","coveralls":"^3.1.0","eslint":"^7.21.0","eslint-config-prettier":"^8.1.0","eslint-config-standard":"^16.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","babel-eslint":"^10.1.0","eslint-plugin-promise":"4.3.1","mocha":"8.3.2","mocha-lcov-reporter":"1.3.0","npm-run-all":"4.1.5","nyc":"15.1.0","rollup":"2.44.0","rollup-plugin-terser":"7.0.2","rollup-plugin-ts-paths":"1.0.5","shx":"0.3.3","sinon":"10.0.0","source-map":"0.7.3","source-map-support":"0.5.19","tsconfig-paths":"3.9.0","ts-mocha":"8.0.0","ts-node":"9.1.1","typescript":"4.2.4","tspath":"1.3.7"},"dependencies":{"tslib":"2.1.0","colorette":"1.2.2","date-fns":"2.21.1","date-fns-tz":"1.1.4"},"scripts":{"build":"npm-run-all clean ~build:dist","clean":"shx rm -rf dist build test/coverage","lint":"eslint . --ext .js,.jsx,.ts,.tsx","package":"npm-run-all clean ~mkdir:dist ~copy","test":"npm-run-all ~test:clean ~test:run","tsc":"tsc -p ./tsconfig.json","tsc:paths":"tsc && tspath -f","~build:dist":"npm-run-all ~rollup ~copy:all","~copy:all":"npm-run-all ~copy:readme ~copy:license ~copy:changelog ~copy:package:json","~copy:changelog":"shx cp ./CHANGELOG.md ./dist","~copy:license":"shx cp ./LICENSE ./dist","~copy:package:json":"json-trim","~copy:readme":"shx cp ./README.md ./dist","~mkdir:dist":"shx mkdir ./dist","~rollup":"rollup -c","~test:clean":"shx rm -rf coverage","~test:run":"nyc ts-mocha --paths -p ./tsconfig.json ./test/**/*.spec.ts","~test:report":"nyc report --reporter=text-lcov | coveralls","------------":"------------------------------------------------------------","demo":"node ./test/objects/demo"},"gitHead":"05b10b46849aa2e27f2219d98fd6e522094c9a95","_id":"@auturge/logger@1.0.1","_nodeVersion":"14.16.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-8s9yx+qGry9Ci96/bZ4X2KC1RuMtyZJLCR6gXomwRRwfikpWfjYtP5VjEGDlc7ly0gf+pNWwtxFsvi+B991NNw==","shasum":"63ae3028696c7239f26fca0ee253dcd5471e02af","tarball":"https://registry.npmjs.org/@auturge/logger/-/logger-1.0.1.tgz","fileCount":89,"unpackedSize":317593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmde5CRA9TVsSAnZWagAAHmUP/iBWt7ZC3EbRNsGGjOjL\nAkwOkh/OZ78CooMnaECByrA6QVHPVmttJMmWlV9ed7w83EzaZ0NN2xJu8JR7\nb8rKZU4gVcrpsq+mumnxy2FXIVjB1SYB5UP5CLKLLExIPEiCsiD5GfVbzVAn\n6R61E7Fk6sbaB3MHFeMEzTwSygAmSG0fref1751DqA3HWbVxMcDR5DKnL7qt\nhn24hqOBZeplOD1chANYq5ZH0AGUn2rm5aHvLcf74LdWIveTl6UPsJ7/uyT/\nZU7FApUYaV/HuPQsJP2cWE0+h5xa1Z2/LEke8zAlyeyvemnFDeHcAw6CUJ0a\n2SboK2v97HWZvur7AVMYBwsZgwJGx3pdQnFcMxIhlBvP3qW+U7MtxKoH+oge\nq7xHGcpOFM8BJ++6Uodf6BzItziWsq0bPFxORtRJ2LAzWoT/g5tSoCgDYYLD\nqsXgaLdTxBWlXT9/QpoMlHyJdmmyRfiGK5ufQRbpyS3FJNYJTdvrawC0KAZK\n/XckzEZr35ETDYqioJYmxJTiGwhanvUvKRcRcsTQONzPe9HlmenZcTJk9vOz\nnt2h8P2iGjcWGQkI1FMuvWL06Mv4EdHbv/jRIl4KTbCwlQrY7vYHrLIA7s6a\nElgjp7YjzQoYC0GOdH0fGPTLO89Pr1ANA5ur0/BR4XEKk7Qmp/7/xori1Gn5\nbu00\r\n=OEWt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiYc43BYuCsxC06wsOgTKT0uKFhER33jhfRLKqWuxytwIgG4KqJ2ej9CludzxZGZY4zvAPMFlTe9rzcBl06eQFhh4="}]},"_npmUser":{"name":"curtis.kaler","email":"curt.kaler@gmail.com"},"directories":{},"maintainers":[{"name":"curtis.kaler","email":"curt.kaler@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logger_1.0.1_1620694968962_0.4405820643208027"},"_hasShrinkwrap":false},"1.0.2":{"name":"@auturge/logger","description":"A handy multiplexing logger.","version":"1.0.2","author":{"name":"auturge"},"license":"MIT","bugs":{"url":"https://github.com/auturge/logger/issues"},"homepage":"https://github.com/auturge/logger","repository":{"type":"git","url":"git+https://github.com/auturge/logger.git"},"engines":{"node":">=12.8.1"},"main":"logger.js","module":"logger.es6.js","browser":"logger.umd.js","devDependencies":{"@auturge/json-trim":"1.0.0","@auturge/testing":"1.0.0","@rollup/plugin-commonjs":"18.0.0","@rollup/plugin-node-resolve":"11.2.1","@types/chai":"4.2.15","@types/mocha":"8.2.2","@types/sinon":"9.0.11","@typescript-eslint/eslint-plugin":"4.20.0","@typescript-eslint/parser":"4.20.0","@wessberg/rollup-plugin-ts":"1.3.11","awesome-typescript-loader":"5.2.1","chai":"^4.3.0","coveralls":"^3.1.0","eslint":"^7.21.0","eslint-config-prettier":"^8.1.0","eslint-config-standard":"^16.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","babel-eslint":"^10.1.0","eslint-plugin-promise":"4.3.1","mocha":"8.3.2","mocha-lcov-reporter":"1.3.0","npm-run-all":"4.1.5","nyc":"15.1.0","rollup":"2.44.0","rollup-plugin-terser":"7.0.2","rollup-plugin-ts-paths":"1.0.5","shx":"0.3.3","sinon":"10.0.0","source-map":"0.7.3","source-map-support":"0.5.19","tsconfig-paths":"3.9.0","ts-mocha":"8.0.0","ts-node":"9.1.1","typescript":"4.2.4","tspath":"1.3.7"},"dependencies":{"tslib":"2.1.0","colorette":"1.2.2","date-fns":"2.21.1","date-fns-tz":"1.1.4"},"scripts":{"build":"npm-run-all clean ~build:dist","clean":"shx rm -rf dist build test/coverage","lint":"eslint . --ext .js,.jsx,.ts,.tsx","package":"npm-run-all clean ~mkdir:dist ~copy","test":"npm-run-all lint ~test:clean ~test:run","tsc":"tsc -p ./tsconfig.json","tsc:paths":"tsc && tspath -f","~build:dist":"npm-run-all ~rollup ~copy:all","~copy:all":"npm-run-all ~copy:readme ~copy:license ~copy:changelog ~copy:package:json","~copy:changelog":"shx cp ./CHANGELOG.md ./dist","~copy:license":"shx cp ./LICENSE ./dist","~copy:package:json":"json-trim","~copy:readme":"shx cp ./README.md ./dist","~mkdir:dist":"shx mkdir ./dist","~rollup":"rollup -c","~test:clean":"shx rm -rf coverage","~test:run":"nyc ts-mocha --paths -p ./tsconfig.json ./test/**/*.spec.ts","~test:report":"nyc report --reporter=text-lcov | coveralls","------------":"------------------------------------------------------------","demo":"node ./test/objects/demo"},"gitHead":"0cf9d4a09b36068a963cc9b8ef757e00d60af000","_id":"@auturge/logger@1.0.2","_nodeVersion":"14.16.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-h5awOzEX8BVJ1q/3eZDZVYotq72B6v+Mx2oDUJiu1vq89cbEkWpYdF4L4eMtRfeiw79PX6APXH2Q14EJ7bWbxw==","shasum":"81aed0003817a2b04ba823392bc75683c55d685f","tarball":"https://registry.npmjs.org/@auturge/logger/-/logger-1.0.2.tgz","fileCount":89,"unpackedSize":317681,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmdlkCRA9TVsSAnZWagAASMoP/3kSDDxqUj9jachZTYVx\nSZPTF1px7Ebn8dExV8yomsN3UCkFqUhxUuCFs+HJnkPuN6LCP0ZEcgyLzMtM\nWbQMasLFps/v3Lb05TjdlG4cp4piaI8Y+4KmHODpH4dBANyrv9arOdoQFkcC\n9KHWRHxU+05Rb1MloHnrk/+3Nl3nf1LYoM6J8G5moyn9OStrl+dAHE2DHfFx\nq2VgzwdVV8GAttMa3cCWKjcJbXbh7FxEKBAqX7km+EuU+fIZmTzbFdbkGslP\ne94bDiUjet4ynHCtMdGnMSzK961OaEPVXHnYk/A1bFO3N7dM8qOdVlyi9oX9\n8ocmjKfaaui+B68lK2D+owKw6dIZejuX2nBaGrrjJBNX+f406iB/Qc1vpMdN\nmr5q6JpQQXsnGytMMrA0AUVZ1KRY6gB5x5bUpanyAoYzoRCeWRgmjCd9/xAn\nTVrIw+oLwDaU4Y+HOJAb9TsYWIrAUyaTVbgneOZg97cud+SjE6Cdh1haTthb\nE4p0DLHATTJjtZP8/hhL4GaKpncCWvsCLWvf1lIguKeDgvZcE0b3hzOzjWP+\nPDA2X6+ZYtmE+nfBxLKHP3576Gho8a99azX5P01x+F+gUZVGu28U0Yj899+6\nwuaq6NLRadoXaYC7EwmqYRPBWC84QHqg+WD/sP+9a5vIiQ7xLNUsVm1AHce0\nQxn7\r\n=rZoa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUVRDd4MszuqTXNy/1+f8jYaOHPQzcrXjpE067IEKLxQIgM0nXHy0L+DJhDRQdbl2v8KhTajPYsQTcVGrCCRji/Po="}]},"_npmUser":{"name":"curtis.kaler","email":"curt.kaler@gmail.com"},"directories":{},"maintainers":[{"name":"curtis.kaler","email":"curt.kaler@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logger_1.0.2_1620695396135_0.812960321458265"},"_hasShrinkwrap":false},"1.0.3":{"name":"@auturge/logger","description":"A handy multiplexing logger.","version":"1.0.3","author":{"name":"auturge"},"license":"MIT","bugs":{"url":"https://github.com/auturge/logger/issues"},"homepage":"https://github.com/auturge/logger","repository":{"type":"git","url":"git+https://github.com/auturge/logger.git"},"engines":{"node":">=12.8.1"},"main":"logger.js","module":"logger.es6.js","browser":"logger.umd.js","dependencies":{"tslib":"2.2.0","colorette":"1.2.2","date-fns":"2.21.3","date-fns-tz":"1.1.4"},"_id":"@auturge/logger@1.0.3","_nodeVersion":"14.16.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-QqS3LNq3gMGb2Qo7TUMT1GXgvsRAVucHppo0u2GEm2QeQNnVjhsPZog43MAl4oLRWJMKBjISl7zxeyxAXZjGYQ==","shasum":"220f445507823a77799d01cf9f0ede5fec7fb421","tarball":"https://registry.npmjs.org/@auturge/logger/-/logger-1.0.3.tgz","fileCount":10,"unpackedSize":199962,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmes+CRA9TVsSAnZWagAA5AUP/RB6aL+0QD4wTN65COrT\nnhkps7dgNk6LDdIoaw8HLGdFWZlanEgat3u3rTjhgKMB+yKqsMqKpJeQenFG\njQmMD2g3id/gQn2pRrbNF509U8mkHuINiukk1lOSKkRMNICqiLfY6samrnUM\naX5AXj4irMWYlcFjqbqr1D8QazCbjBvQUU32ywUYoOPbHCf5KZLvz65jEXtE\n04z2MXElbsnmkgY4As308fsOQTncEpT6J1DkA4mI+3VZUyG3n9J7+4Zu42gB\n7eyiAeHTwji1bP96A67tn158FI3Ip2Bmayst+UHLkDzMAihHPbHjGuu+OR2X\nyoL9/6Iwj+2vCYh2GiAcvuYWirz86IVwn7XiZm8LqETsKXPvnXvV827Fd3ii\nb83A9/Lz/DXMlJf160iws/vlAr4vc0u4c9fiq5H4exO0dk4E98vqs+oaA+LP\nNkxeP0wr5D6ypXRU5aWX9x1jta4CMSyZMvpOAIKBejMvpOpSPtu4L+O0IR3C\nh0SCQuy9yI/5qbNJ0g8VyxBioJIzJeNTvcRvkKgF1xb/qONjyhKO05XtZNYM\niWVKIFbbr0uk2x14UYZqQEvTNkd/RELpDZCaIO6yeWJ6yPyzgoYl26DnTeNC\ngnJVnf99T6MQvq0Xp/qsJCKIuzUBIpyAVTaSFi35IzhobSvSE3aLgHDn1rXY\nwMxS\r\n=1rKO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzs5WH27RyjKzt4N6+io+gGLcEGwwkqroF2xGplO+q2gIgRaYQLrvMBmE1fiBnvIZ+Hj4X4oH2zSbBsiteUXSVnRQ="}]},"_npmUser":{"name":"curtis.kaler","email":"curt.kaler@gmail.com"},"directories":{},"maintainers":[{"name":"curtis.kaler","email":"curt.kaler@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logger_1.0.3_1620699965488_0.9867094473180844"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-10T00:48:12.767Z","1.0.0":"2021-05-10T00:48:13.235Z","modified":"2022-04-04T16:41:25.194Z","1.0.1":"2021-05-11T01:02:49.124Z","1.0.2":"2021-05-11T01:09:56.298Z","1.0.3":"2021-05-11T02:26:05.668Z"},"maintainers":[{"name":"curtis.kaler","email":"curt.kaler@gmail.com"}],"description":"A handy multiplexing logger.","homepage":"https://github.com/auturge/logger","repository":{"type":"git","url":"git+https://github.com/auturge/logger.git"},"author":{"name":"auturge"},"bugs":{"url":"https://github.com/auturge/logger/issues"},"license":"MIT","readme":"# <h1 id=\"top\" align=\"center\">auturge/logger</h1> #\r\n\r\n<p align=\"center\">\r\n  A set of helpful functions for developer convenience.\r\n</p>\r\n\r\n[![License][license-image]][license-url]\r\n[![NPM Version][npm-image]][npm-url]\r\n[![Build Status][travis-image]][travis-url]\r\n[![Coverage Status][coveralls-image]][coveralls-url]\r\n\r\n<br>\r\n\r\n>\r\n> [![Work In Progress][WIP-badge]](#top)\r\n>\r\n> This readme is incomplete.\r\n>\r\n> I'm working on it, but I also have to sleep sometimes! :sleeping:\r\n\r\n<br>\r\n\r\n- [Installation](#installation)\r\n- [Examples](#examples)\r\n- [API](#api)\r\n    - [Abstractions](#abstractions)\r\n        - [`ILog`](#ilog)\r\n            - [`fatal`](#fatal)\r\n            - [`error`](#error)\r\n            - [`warn`](#warn)\r\n            - [`info`](#info)\r\n            - [`debug`](#debug)\r\n            - [`trace`](#trace)\r\n        - [`IStatusLog`](#istatuslog)\r\n        - [`ILogEntry`](#ilogentry)\r\n        - [`IStatusLogEntry`](#istatuslogentry)\r\n        - [`IWriter`](#iwriter)\r\n        - [`ILogManager`](#ilogmanager)\r\n        - [`ILogBuilder`](#ilogbuilder)\r\n    - [Instances](#instances)\r\n        - [`Log`](#log)\r\n            - [`fatal`](#fatal)\r\n            - [`error`](#error)\r\n            - [`warn`](#warn)\r\n            - [`info`](#info)\r\n            - [`debug`](#debug)\r\n            - [`trace`](#trace)\r\n            - [`success`](#success)\r\n            - [`failure`](#failure)\r\n            - [`mark`](#mark)\r\n        - [`LogManager`](#logmanager)\r\n            - [`initialize`](#initialize)\r\n            - [`disable`](#disable)\r\n            - [`enable`](#enable)\r\n            - [`getLog`](#getlog)\r\n        - [`LogBuilder`](#logbuilder)\r\n        - [loggers](#loggers)\r\n            - [`TerminalLog`](#terminallog)\r\n            - [`ConsoleLog`](#consolelog)\r\n        - [writers](#writers)\r\n            - [`TERMINAL`](#terminal)\r\n            - [`CONSOLE`](#console)\r\n- [Tables](#tables)\r\n- [Caveats](#caveats)\r\n- [License](#license)\r\n\r\n<br>\r\n\r\n----\r\n\r\n## Installation ##\r\n\r\n> ```shell\r\n> $ npm install @auturge/logger\r\n> ```\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n## Introduction ##\r\n\r\nI needed a quick way to log messages to the console or terminal with custom formatting (like colored success, error, and warning messages). Something like log4xxx, or nLog, but for TypeScript/javascript.\r\n\r\nI felt like reinventing the wheel (_so naughty_), so here's a handy, extensible logger library.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n## Examples ##\r\n\r\n### Use the default [\"Log\"](#log) to log a message ###\r\n\r\n```ts\r\nimport { Log } from '@auturge/logger';\r\n\r\nLog.info('Doing a thing...');\r\n```\r\n\r\n... which is shorthand for...\r\n\r\n### Create and configure a single console logger at the TRACE level ###\r\n\r\n```ts\r\nimport { LogManager, TERMINAL, LogLevel } from '@auturge/logger';\r\n\r\nconst logger = LogManager.initialize\r\n                         .newChannel('terminal', TERMINAL, LogLevel.INFO)\r\n                         .andGetLogger();\r\n\r\nlogger.info('Doing a thing...');\r\n```\r\n\r\n... or you could do something a little more complicated:\r\n\r\n### Create and configure a multiplexing logger ###\r\n\r\n```ts\r\nimport { \r\n    LogManager, TerminalWriter, DateFormat, LogLevel, IWriter\r\n    } from '@auturge/logger';\r\nimport { MyFileWriter } from 'whatever-file-you-put-it-in';\r\n\r\n// use the included terminal writer\r\nconst TERMINAL: IWriter = new TerminalWriter(` %{ date | ${ DateFormat.DEFAULT } } | %{level} | %{message}`);\r\n\r\n// write your own file-writer\r\nconst MY_FILE_WRITER: IWriter = new MyFileWriter('%{date} | %{level} | %{message}');\r\n\r\nconst logger = LogManager.initialize\r\n                         .newChannel('terminal', LogLevel.INFO, TERMINAL)\r\n                         .newChannel('file', LogLevel.TRACE, MY_FILE_WRITER)\r\n                         .andGetLogger();\r\n\r\nlogger.error('Look! An error which will appear in both logs...', error);\r\n\r\nlogger.info('Look! A log entry which will appear in both logs...');\r\n\r\nlogger.trace('Look! An entry that will only appear in the debug log file...');\r\n\r\n```\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n## API ##\r\n\r\nThere are several abstraction exposed by @auturge/logger:\r\n\r\n- [`ILog`](#i-log)\r\n- [`ILogEntry`](#i-log-entry)\r\n- [`IWriter`](#i-writer)\r\n- [`LogManagerClass`](#log-manager-class)\r\n- [`LogBuilder`](#log-builder)\r\n\r\nThere are also several class instances:\r\n\r\n- [`Log`](#log),\r\n    - [`fatal`](#fatal)\r\n    - [`error`](#error)\r\n    - [`warn`](#warn)\r\n    - [`info`](#info)\r\n    - [`debug`](#debug)\r\n    - [`trace`](#trace)\r\n    - [`success`](#success)\r\n    - [`failure`](#failure)\r\n    - [`mark`](#mark)\r\n- [`LogManager`](#log-manager),\r\n- [`ConsoleLog` and `TerminalLog` (loggers)](#loggers),\r\n- [`CONSOLE` and `TERMINAL` (writers)](#writers)\r\n\r\n...and a number of enums:\r\n\r\n- [`DateFormat`](#dateformat)\r\n- [`LogLevel`](#loglevel)\r\n- [`LogStatus`](#logstatus)\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n## Abstractions ##\r\n\r\n@auturge/logger exposes several abstractions, designed to make the library extensible:\r\n\r\n- [`ILog`](#ilog)\r\n    - [`fatal`](#fatal)\r\n    - [`error`](#error)\r\n    - [`warn`](#warn)\r\n    - [`info`](#info)\r\n    - [`debug`](#debug)\r\n    - [`trace`](#trace)\r\n- [`ILogEntry`](#i-log-entry)\r\n- [`IWriter`](#i-writer)\r\n- [`LogManagerClass`](#log-manager-class)\r\n- [`LogBuilder`](#log-builder)\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n### ILog ###\r\n\r\n> `ILog`: An interface describing the properties and methods used to log messages.\r\n\r\nAny `ILog<TLog, TEntry>` exposes the following members:\r\n\r\n- [`channels`](#channels)\r\n- [`name`](#name)\r\n- [`reconfigured`](#reconfigured)\r\n- [`enabled`](#enabled)\r\n- [`setLevel`](#setlevel)\r\n\r\nalong with several logging-specific methods:\r\n\r\n- [`fatal`](#fatal)\r\n- [`error`](#error)\r\n- [`warn`](#warn)\r\n- [`info`](#info)\r\n- [`debug`](#debug)\r\n- [`trace`](#trace)\r\n\r\n> Unfortunately Github Flavored Markdown (GFM) does not support custom text colors wtihout using hacky workarounds or placeholder sites, so I won't demo colors here, but instead provide a table:\r\n\r\n|Method|Color|\r\n|:---|:---|\r\n|fatal|red|\r\n|error|red|\r\n|warn|yellow|\r\n|info|default console color|\r\n|debug|cyan|\r\n|trace|default console color|\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n#### `fatal` ####\r\n\r\n> ```javascript\r\n> ILog.fatal(message: string): void;\r\n> ILog.fatal(message: string, obj: any): void;\r\n> ILog.fatal(message: string, obj: any, prettyPrint: boolean): void;\r\n> ```\r\n\r\nFormats and writes a fatal log message.\r\n\r\nThis is the log level that tells the user that the application has encountered an event or entered a state in which one of the crucial business functionalities is no longer working. A FATAL log level may be used when the application is not able to connect to a crucial data store like a database or all the payment systems are not available and users can’t checkout their baskets in your e-commerce.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n#### `error` ####\r\n\r\n> ```javascript\r\n> ILog.error(message: string): void;\r\n> ILog.error(message: string, obj: any): void;\r\n> ILog.error(message: string, obj: any, prettyPrint: boolean): void;\r\n> ```\r\n\r\nFormats and writes an error log message.\r\n\r\nThis tells the user that the application has hit an issue preventing one or more functionalities from properly functioning. The ERROR level can be used when one of the payment systems is not available, but there is still the option to check out the basket in the e-commerce application or when your social media logging option is not working for some reason.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n#### `warn` ####\r\n\r\n> ```javascript\r\n> ILog.warn(message: string): void;\r\n> ILog.warn(message: string, obj: any): void;\r\n> ILog.warn(message: string, obj: any, prettyPrint: boolean): void;\r\n> ```\r\n\r\nFormats and writes a warning log message.\r\n\r\nThis tells the user that something unexpected happened in the application: a problem, or a situation that might disturb one of the processes. But that doesn’t mean that the application failed. The WARN level should be used in situations that are unexpected, but the code can continue the work. For example, a parsing error occurred that resulted in a certain document not being processed.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n#### `info` ####\r\n\r\n> ```javascript\r\n> ILog.info(message: string): void;\r\n> ILog.info(message: string, obj: any): void;\r\n> ILog.info(message: string, obj: any, prettyPrint: boolean): void;\r\n> ```\r\n\r\nFormats and writes an informational log message.\r\n\r\nThis is the standard log level indicating that something happened, the application entered a certain state, etc. For example, a controller of your authorization API may include an INFO log entry with information on which user requested authorization if the authorization was successful or not. The information logged using the INFO log level should be purely informative and not looking into them on a regular basis shouldn’t result in missing any important information.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n#### `debug` ####\r\n\r\n> ```javascript\r\n> ILog.debug(message: string): void;\r\n> ILog.debug(message: string, obj: any): void;\r\n> ILog.debug(message: string, obj: any, prettyPrint: boolean): void;\r\n> ```\r\n\r\nFormats and writes a debug log message.\r\n\r\nThis level is less granular compared to the TRACE level, but it is more than you will need in everyday use. The DEBUG log level should be used for information that may be needed for diagnosing issues and troubleshooting or when running application in the test environment for the purpose of making sure everything is running correctly\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n#### `trace` ####\r\n\r\n> ```javascript\r\n> ILog.trace(message: string): void;\r\n> ILog.trace(message: string, obj: any): void;\r\n> ILog.trace(message: string, obj: any, prettyPrint: boolean): void;\r\n> ```\r\n\r\nFormats and writes a trace log message.\r\n\r\nThis level is for the most fine-grained information only used in rare cases where you need the full visibility of what is happening in your application and inside the third-party libraries that you use. You can expect the TRACE logging level to be very verbose. You can use it for example to annotate each step in the algorithm or each individual query with parameters in your code.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n## Instances ##\r\n\r\n@auturge/logger exposes several 'default' implementations of the provided abstractions:\r\n\r\n- [`Log`](#log)\r\n    - [`fatal`](#fatal)\r\n    - [`error`](#error)\r\n    - [`warn`](#warn)\r\n    - [`info`](#info)\r\n    - [`debug`](#debug)\r\n    - [`trace`](#trace)\r\n    - [`success`](#success)\r\n    - [`failure`](#failure)\r\n    - [`mark`](#mark)\r\n- [`LogManager`](#log-manager)\r\n- [`ConsoleLog` and `TerminalLog` (loggers)](#loggers)\r\n- [`CONSOLE` and `TERMINAL` (writers)](#writers)\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n### Log ###\r\n\r\n> Log: A default terminal logger for quick out-of-the-box logging.\r\n\r\nAny [`ILog`](#ilog) exposes the following methods:\r\n\r\n- [`fatal`](#fatal)\r\n- [`error`](#error)\r\n- [`warn`](#warn)\r\n- [`info`](#info)\r\n- [`debug`](#debug)\r\n- [`trace`](#trace)\r\n\r\nThe `Log` is an [`IStatusLog`](#istatuslog), a special type of [`ILog`](#ilog) which also exposes the following logging methods:\r\n\r\n- [`success`](#success)\r\n- [`failure`](#failure)\r\n- [`mark`](#mark)\r\n\r\nIn addition, `Log` will colorize each log entry.\r\n\r\n> Unfortunately Github Flavored Markdown (GFM) does not support custom text colors wtihout using hacky workarounds or placeholder sites, so I won't demo colors here, but instead provide a table:\r\n\r\n|Method|Color|\r\n|:---|:---|\r\n|fatal|red|\r\n|error|red|\r\n|warn|yellow|\r\n|info|default console color|\r\n|debug|cyan|\r\n|trace|default console color|\r\n|success|green|\r\n|failure|red|\r\n|mark|magenta|\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n#### `success` ####\r\n\r\n> ```javascript\r\n> IStatusLog.success(message: string): void;\r\n> IStatusLog.success(message: string, obj: any): void;\r\n> IStatusLog.success(message: string, obj: any, prettyPrint: boolean): void;\r\n> ```\r\n\r\nFormats and writes a success log message.\r\n\r\nThis is for informing the user of some significant operational success.\r\n\r\nSome examples of `success` messages:\r\n\r\n- 'All done!'\r\n- 'Successfully logged in!'\r\n\r\n> NOTE: `success` entries are logged at the `info` level.\r\n>\r\n> Setting the level of the logger higher than `info` will filter out any `success` messages.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n#### `failure` ####\r\n\r\n> ```javascript\r\n> IStatusLog.failure(message: string): void;\r\n> IStatusLog.failure(message: string, obj: any): void;\r\n> IStatusLog.failure(message: string, obj: any, prettyPrint: boolean): void;\r\n> ```\r\n\r\nFormats and writes a trace log message.\r\n\r\nThis is for informing the user of some significant operational failure _that is tied to **user action**_. Failure messages represent **user errors**, not exceptional code failures (for that, use `error` or `fatal`).\r\n\r\nSome examples of `failure` messages:\r\n\r\n- 'Failed to log in!' (due to an HTTP 401 error, not a 500)\r\n- 'Passwords must include at least 12 letters (both upper- and lowercase), at least 1 number, and at least 1 symbol.'\r\n\r\n> NOTE: `failure` entries are logged at the `info` level.\r\n>\r\n> Setting the level of the logger higher than `info` will filter out any `failure` messages.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n#### `mark` ####\r\n\r\n> ```javascript\r\n> IStatusLog.mark(message: string): void;\r\n> IStatusLog.mark(message: string, obj: any): void;\r\n> IStatusLog.mark(message: string, obj: any, prettyPrint: boolean): void;\r\n> ```\r\n\r\nFormats and writes a marking log message.\r\n\r\nThis is best used to describe events that need to stand out in the log.\r\n\r\nSome examples of `mark` messages:\r\n\r\n-\r\n        `Entering method ${ methodName } at ${ timestamp }`\r\n-\r\n        `Exiting method ${ methodName } at ${ timestamp }`\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n### LogManager ###\r\n\r\n> LogManager: The default StatusLog manager.\r\n\r\nAny `ILogManager` exposes the following members:\r\n\r\n- [`initialize`](#initialize)\r\n- [`disable`](#disable)\r\n- [`enable`](#enable)\r\n- [`getLog`](#getlog)\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n#### `initialize` ####\r\n\r\n> A `LogBuilder` that configures a logger.\r\n\r\n`LogManager.initialize` is meant to be a [fluent interface][fluent-interface], and exposes the following members:\r\n\r\n- [`andGetLogger`](#andgetlogger)\r\n- [`atLevel`](#atlevel)\r\n- [`newLog`](#newlog)\r\n- [`newChannel`](#newchannel)\r\n\r\n<br>\r\n\r\nExample:\r\n\r\n```javascript\r\nconst consoleLog = LogManager.initialize\r\n    .newLog('console log')\r\n    .newChannel('console channel', CONSOLE, LogLevel.INFO)\r\n    .andGetLogger();\r\n    \r\nconsoleLog.mark('Logger configured.');\r\n```\r\n\r\n<br>\r\n\r\nFor more details, see the [ILogBuilder](#ilogbuilder) abstraction.\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n#### `disable` ####\r\n\r\n> ```javascript\r\n> LogManager.disable(logName: string): void;\r\n> ```\r\n\r\nDisables the log with the given name.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n#### `enable` ####\r\n\r\n> ```javascript\r\n> LogManager.enable(logName: string): void;\r\n> ```\r\n\r\nEnables the log with the given name.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n#### `getLog` ####\r\n\r\n> ```javascript\r\n> LogManager.getLog(logName: string): ILog | null;\r\n> ```\r\n\r\nReturns the `ILog` instance with the given name.\r\nReturns `null` if not found.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n### Loggers ###\r\n\r\n> ConsoleLog: The default console logger.\r\n>\r\n> TerminalLog: The default terminal logger.\r\n\r\nBoth `ConsoleLog` and `TerminalLog` are instances of the `IStatusLog` abstraction.\r\n\r\n<br>\r\n\r\n#### `TerminalLog` ###\r\n\r\n`TerminalLog` is the default logger the terminal (e.g., for use in node applications). It has a single channel, called 'terminal', utilizing a [`TerminalWriter`](#terminalwriter), and configured at [`LogLevel.INFO`](#log-levels).\r\n\r\n<br>\r\n\r\n#### `ConsoleLog` ###\r\n\r\n`ConsoleLog` is the default logger for the browser console.\r\nIt has a single channel, called 'console', utilizing a [`ConsoleWriter`](#terminalwriter), and also configured at [`LogLevel.INFO`](#log-levels).\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n### Writers ###\r\n\r\n> CONSOLE: The default console writer.\r\n>\r\n> TERMINAL: The default terminal writer.\r\n\r\nBoth `CONSOLE` and `TERMINAL` are instances of the `IWriter` abstraction.\r\n\r\n<br>\r\n\r\n#### `TERMINAL` ####\r\n\r\n`TERMINAL` is the default writer for the terminal (e.g., for use in node applications).\r\n\r\n<br>\r\n\r\n#### `CONSOLE` ####\r\n\r\n`CONSOLE` is the default writer for the browser console.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n----\r\n\r\n## Tables ##\r\n\r\n### Date Formatting ###\r\n\r\nDate formatting is based on [Unicode Technical Standard #35][tr35].\r\n\r\nSpecifically, it depends on the [date-fns][date-fns] and [date-fns-tz][date-fns-tz] libraries to do most of the date formatting.\r\n\r\nDate token format: ```{ %date [```&#8203;```|<format string>[```&#8203;```| <timezone> ] ] }```\r\n\r\nexample timestamp: ```2021-04-25 19:00:43.426 GMT-7 (America/Los Angeles)```\r\n\r\n| Date Format | desired result | date token |\r\n|:---|:---|:---|\r\n| Default | ```2021-04-25 19:00:43.426 -07:00``` | ```%{ date }``` |\r\n| \"long\" format | ```2021-04-26 19:00:43 -0700``` | ```%{ date \\| yyyy-MM-dd HH:mm:ss XXXX }``` |\r\n| ISO-8601 (UTC) | ```2021-04-26T02:00:43.426Z``` | ```%{ date \\| yyyy-MM-dd'T'HH:mm:ss.SSS'Z' \\| UTC }``` |\r\n| UTC format |\t```Mon, 26 Apr 2021 02:00:43 UTC``` |\t```%{ date \\| EEE',' dd MMM yyyy HH:mm:ss xxx \\| UTC }``` |\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n<br>\r\n\r\n### Logging Writers ###\r\n\r\nWe need to enable logging to many possible targets, for example:\r\n\r\n| Example Target\t| Description |\r\n|:---|:---|\r\n|[`CONSOLE`](#console)\t| The browser console |\r\n|[`TERMINAL`](#terminal)\t| The terminal (non-browser) |\r\n<!-- |DATABASE\t| Log entries into a database | -->\r\n<!-- |FILE\t    | Log into a file (non-browser only) | -->\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n<br>\r\n\r\n### Log Levels ###\r\n\r\n|Log Level\t|Importance|\r\n|:---|:---|\r\n|Fatal\t|One or more key business functionalities are not working and the whole system doesn’t fulfill the business functionalities.|\r\n|Error\t|One or more functionalities are not working, preventing some functionalities from working correctly.|\r\n|Warn\t|Unexpected behavior happened inside the application, but it is continuing its work and the key business features are operating as expected.|\r\n|Info\t|An event happened, the event is purely informative and can be ignored during normal operations.|\r\n|Debug\t|Useful during software debugging when more granular information is needed.|\r\n|Trace\t|Step by step execution of your code that can be ignored during the standard operation, but may be useful during extended debugging sessions.|\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n<br>\r\n\r\n### Entry Statuses ###\r\n\r\n| Status\t|Importance|\r\n|:---|:---|\r\n| failure\t| Non-code failure (login failure, etc.) |\r\n| info\t\t| Informational |\r\n| mark\t\t| Code-execution condition, timestamp, or metrics. |\r\n| success\t| Successful completion of an operation. |\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n<br>\r\n\r\n### Log Entry Fields ###\r\n\r\n|Log Entry Property\t|Importance|\r\n|:---|:---|\r\n|data\t\t| Any accompanying data that should be included and logged. |\r\n|level\t\t| The level at which to log the message. |\r\n|message\t| The message to log. |\r\n|source\t\t| The source of the log entry. |\r\n|timestamp\t| The date and time of the entry. |\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n<br>\r\n\r\n----\r\n\r\n## Caveats ##\r\n\r\n- @auturge/logger does not (currently) include functionality that makes it a **file** or **database** logger, but an interested party might create such an `IWriter`, and I might be happy to review and include it.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n<br>\r\n\r\n----\r\n\r\n## License ##\r\n\r\nDistributed under the MIT license. See [`LICENSE`][license] for more information.\r\n\r\n<br>\r\n\r\n<a href=\"#top\">(go to top)</a>\r\n\r\n<br>\r\n\r\n[auturge-github-homepage]: https://github.com/auturge/auturge\r\n[WIP-badge]: https://img.shields.io/static/v1?label=WIP:&message=Work-in-Progress&color=blueviolet\r\n[license]: https://github.com/auturge/auturge/blob/master/LICENSE\r\n[license-image]: http://img.shields.io/:license-mit-blue.svg?style=flat-square\r\n[license-url]: http://badges.mit-license.org\r\n[npm-image]: https://img.shields.io/npm/v/@auturge/logger.svg\r\n[npm-url]: https://www.npmjs.com/package/@auturge/logger\r\n[travis-image]: https://travis-ci.com/auturge/logger.svg?branch=master\r\n[travis-url]: https://travis-ci.com/github/auturge/logger\r\n[coveralls-image]: https://coveralls.io/repos/github/auturge/logger/badge.svg?branch=master\r\n[coveralls-url]: https://coveralls.io/github/auturge/logger?branch=master\r\n\r\n[tr35]: https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\r\n[date-fns]: https://date-fns.org/\r\n[date-fns-tz]: https://www.npmjs.com/package/date-fns-tz\r\n[fluent-interface]: https://martinfowler.com/bliki/FluentInterface.html\r\n","readmeFilename":"README.md"}