{"_id":"vue-logger-plugin","_rev":"54-6f8fe2015bdaa3042f61bd3f89274126","name":"vue-logger-plugin","dist-tags":{"latest":"2.2.3","1.x-latest":"1.2.3"},"versions":{"1.0.0":{"name":"vue-logger-plugin","version":"1.0.0","description":"Flexible logging functionality for Vue.js","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags"},"dependencies":{},"devDependencies":{"@types/jest":"^25.1.4","@types/node":"^13.9.1","jest":"^25.1.0","ts-jest":"^25.2.1","tslib":"^1.11.1","tslint":"^6.1.0","typescript":"^3.8.3","vue":"^2.6.11"},"keywords":["vue","logger","logging"],"gitHead":"df2642157d978b5675b0cc7ea154f874b4c3e1a7","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@1.0.0","_nodeVersion":"10.17.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-aFO/MVv/EyKAgqye261vS4VZN5qyS5Q0Jun0L4/R3j133QMjZV2P8qp+tEAKCOupA7Yk9q8CAMSkWNe0/aD3RQ==","shasum":"7a3c86d4fc84c8bb8c98949259af2f527dbbf446","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-1.0.0.tgz","fileCount":15,"unpackedSize":23976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeg7IHCRA9TVsSAnZWagAAwVQQAJQB9MZNgP730lIV08ij\nV19Rp2nQwpbPCiRsWkpGlIee/+4/JX8ynungvdR67HVDc+VPAi8F4sYHX1v8\n56j831UrhXbkIFmhA6JRA1ih/njNAOTKQEpAq0FlUf5ekcllC/vd5J0dT/Zz\nP+FewSaFFL9QdkUa5sI5SR4BXpl+tqJ9ENp+BEVuckt3KbFi6+5UAaRhp38f\n3biRZb05amZmieUHh/YaK21QvldRualAOOZ6B4saB2XxqGiXCqE0VOT9bFVm\nJ6u9i7iagUFTCgCI9C1Np6+aSrVN2QxZUzcDGFkfSzwC6xcu6f5hbVRcbHnP\nraJnpOsBzu5cxIk+A1DV2k42opQ19os/Bo+CF6bXdAYC/xXNHHqJ3Lffzyh3\njUKUvjVwd9RufcEpeUQZ5atXTRjPG514dsOEqwV5poBt56+BwuMPOPYrHbdw\nCuSGbP9UB1fOSdtns4ECwRfCT/LEyyVgrHE6vvLWtldGtvB/dGb7c9tqXTpU\nSOPJd7+1fk0x9U7tzYPEy+xmo5bM+axBRn5zp52hD+3lOWv/kDgt47rmk601\nhfvg+o1k5+hEXZOvbB3gGbb1WCmbwNM21DHmQCF1gOo8OltNhB4Zu6n0OiuQ\nd5qA5+YPsWA274XmY1ZKCv9U51usGMjrIKNPHr6BHW9AGp/RVpeo2J4pW6r9\n8UeO\r\n=Swi4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFbsY15vYYLxmbUFug1vY7J7poMJTuLtk0e9YrlRSGdjAiEA6ja4fXPlN2JU9oK7TKCd2tzYTrWmEWnIvJ0dRdm67/c="}]},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_1.0.0_1585689094822_0.6358998652442793"},"_hasShrinkwrap":false},"1.0.1":{"name":"vue-logger-plugin","version":"1.0.1","description":"Flexible logging functionality for Vue.js","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags"},"dependencies":{},"devDependencies":{"@types/jest":"^25.1.4","@types/node":"^13.9.1","jest":"^25.1.0","ts-jest":"^25.2.1","tslib":"^1.11.1","tslint":"^6.1.0","typescript":"^3.8.3","vue":"^2.6.11"},"keywords":["vue","logger","logging"],"gitHead":"4d41a5ee9d4ad2a36b9a419f65dea8d066147a51","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@1.0.1","_nodeVersion":"10.17.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-l/cAYT98DQ5bSyR1yCGDu6gY/WU8E6jQtw6KF+yJb9HjgWak3/YeyNCR3VHuu8XFgRmVL1AdE6uQx46cmNRMVg==","shasum":"406b3df3c6c2ac7507a0a3b96975f8370d3320a1","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-1.0.1.tgz","fileCount":16,"unpackedSize":24947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGOAcCRA9TVsSAnZWagAALIwQAIx/iLQ7o8eC+8PEbxKC\nChKkXnzkuIYWfBQ6v2JNfhWGWcJ2tVhu2NJtAeeRX/cbSlWUAipdTsu9oRvB\nJELsEB87xbz/oTNYHSlvys4GxG0qcXfDXYqSuy38x00NS9gTVySunWzsGqWU\n+nzUq1G11tp/nhU+ro2g5DgEgcADRpCId1AxVWNSzvOcJYZL1fkGkA6IoCvQ\nUscWzdiz7yy8qIESXVFDImbtib67//tHq9017yjLECqxJZk3gUdI5B7D/Fn7\nT2kL19lV3vC7uxtZciB00UUOQC5eORX2T8Q0N8XKINKD8WD8qE8IV4Xjpa10\nezMkEIPW8JL7PyOgsv8x9z0ykhdG78NAkhWF8Lm2hhaBVnf8l46z1ZqDBX0Z\nsUC/fnRRLwXt1mRu28aPF3c0+8f/a7G4N5RRnm3UPHlvPbp9MyNT+qPQa4vh\nMSbMC1zjejQZ0jf4Iehc8q6UhlAb6ruT/rVHEuDVERG/1b3j8r9Pkf9V114N\niDK7JAnuqlBYO8eE8BcRniWSK0MdfkewpkMeS2gO2a/3iHBF3dWiitmOcmH0\noFvQy8U4iT+5pNQa9odrQHN3OGenstuBO0C8XADFafTKE1iVBO6peJaugEsS\nSsbk0Q55sGtxpzO6zlgqrFFl4PwKMmLHbQl6VvyvkPqmJoJf5rPSIBn4ghRo\nubjW\r\n=cR7s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICAQEUSWBmEVlaqkcHY3PM8VsXS5k29AeAq+UeYaZFYNAiEAlCINEp2YNQZYWZ+0QxM3L64VeoHSxWMrl10Dz/SSlHg="}]},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_1.0.1_1595465756415_0.7866658970463516"},"_hasShrinkwrap":false},"2.0.0-beta.0":{"name":"vue-logger-plugin","version":"2.0.0-beta.0","description":"Flexible logging functionality for Vue.js 2 & 3","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags"},"dependencies":{},"devDependencies":{"@types/jest":"^25.2.3","@types/node":"^13.13.15","jest":"^25.5.4","ts-jest":"^25.5.1","tslib":"^1.13.0","tslint":"^6.1.3","typescript":"^3.9.7","vue":"^3.0.0-beta.20"},"keywords":["vue","vue 2","vue 3","logger","logging"],"readme":"# vue-logger-plugin\r\n\r\n> Flexible logging functionality for Vue.js with support for custom hook operations.\r\n\r\n[![NPM Version][npm-image]][npm-url]\r\n[![License][license-image]][license-url]\r\n\r\n*Note:*\r\n*Versions 2.x support Vue 3 and versions 1.x support Vue 2.*\r\n*For documentation related to Vue 2, view a 1.x tag*\r\n\r\nContents\r\n=================\r\n* [NPM Package Install](#npm-package-install)\r\n* [Vue Plugin Install](#vue-plugin-install)\r\n* [Options](#options)\r\n* [Hooks](#hooks)\r\n    * [Built-in Hooks](#built-in-hooks)\r\n    * [Write Your Own Hooks](#write-your-own-hooks)\r\n* [Usage](#usage)\r\n* [License](#license)\r\n* [Changelog](CHANGELOG.md)\r\n\r\n## NPM Package Install\r\n\r\n```sh\r\nnpm i vue-logger-plugin\r\n```\r\n\r\n## Vue Plugin Install\r\n\r\nThe logging implementation can be installed by creating a logger instance using ```createlogger``` and providing that logger instance to the Vue ```App.use``` method.  \r\n\r\nHere is the simplest usage:\r\n\r\n**`main.js`**\r\n```js\r\nimport { createApp, h } from 'vue';\r\nimport { createLogger } from 'vue-logger-plugin'\r\nimport App from './App.vue'\r\ncreateApp({\r\n  render: () => h(App)\r\n})\r\n  .use((createLogger({}))\r\n  .mount('#app')\r\n```\r\n\r\nDoing the above will install the logger with the basic default options.\r\n\r\nFor advanced usage (i.e. using conditional options and hooks), it is recommended to export the constructed logger instance in a separate file and then import into your main file.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport { createLogger } from 'vue-logger-plugin'\r\n\r\n// create logger with options\r\nconst logger = createLogger({\r\n  enabled: true,\r\n  level: 'debug',\r\n  beforeHooks: [ ... ],\r\n  afterHooks: [ ... ]\r\n})\r\n\r\nexport default logger\r\n```\r\n**`main.js`**\r\n```js\r\n// ...\r\nimport logger from './logger'\r\ncreateApp({\r\n  render: () => h(App)\r\n})\r\n  .use(logger)\r\n  .mount('#app')\r\n```\r\n\r\nMore information about hooks can be found in the [Hooks](#Hooks) section.\r\n\r\n### Options\r\n*(default values shown)*\r\n```js\r\n{\r\n  enabled: true,    // {boolean} enable/disable logging\r\n  level: 'debug',   // {string} the logging level (one of: debug, info, warn, error)\r\n  beforeHooks: [],  // {LoggerHook[]} hooks invoked before a statement is logged, can be used to alter log arguments (use carefully)\r\n  afterHooks: []    // {LoggerHook[]} hooks invoked after a statement is logged\r\n}\r\n```\r\n\r\n### Hooks\r\n\r\nHooks allow for advanced customization of the logger implementation, providing operations to be run before and after logging is performed.  These are defined on options as ```beforeHooks``` and ```afterHooks```.\r\n\r\n##### beforeHooks\r\nInvoked before a statement is logged, can alter the log arguments which can impact the log output.\r\n\r\n##### afterHooks\r\nInvoked after a statement is logged, cannot impact the log output.\r\n\r\n#### Built-in Hooks\r\nThe following hooks are available in this package and can be used by simply importing and adding them to the beforeHooks and/or afterHooks arrays of your options.\r\n\r\n**`StringifyObjectsHook`**\r\nApplies JSON.stringify on all objects provided as arguments to a logging method.\r\n```js\r\nimport { createLogger, StringifyObjectsHook } from 'vue-logger-plugin'\r\nconst logger = createLogger({\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyObjectsHook\r\n  ]\r\n})\r\n```\r\n**`StringifyAndParseObjectsHook`**\r\nApplies JSON.stringify and JSON.parse on all objects provided as arguments to a logging method.\r\n```js\r\nimport { createLogger, StringifyAndParseObjectsHook } from 'vue-logger-plugin'\r\nconst logger = createLogger({\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyAndParseObjectsHook\r\n  ]\r\n})\r\n```\r\n\r\nThe above are best used as 'before hooks' as they may purposefully alter the log output.  This way you are sure you are seeing the value of an object at the moment you log it. Otherwise, many browsers provide a live view that constantly updates as values change.\r\n\r\n#### Write Your Own Hooks\r\n\r\nYou can easily write your own hooks to apply custom logic.  A hook must implement a ```run``` function to handle a log event (an object containing the log level and the array of arguments which were passed to the logging method), and may optionally implement an ```install``` function which is invoked during plugin installation (or at the time of logger options application - see [Usage](#usage) section).\r\n\r\nFor reference, here are the interfaces:\r\n```ts\r\nexport interface LoggerHook {\r\n  run (event: LogEvent): void\r\n  install? (options: LoggerOptions): void\r\n  props?: { [key: string]: any }\r\n}\r\nexport interface LogEvent {\r\n  level: string\r\n  argumentArray: any[]\r\n}\r\n```\r\n\r\n##### Sample Custom Hook - Leveraging Axios to Send Logs to Server\r\nThis is a basic example demonstrating how you could have the logger send log data to a server using an Axios client.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport { createLogger, StringifyObjectsHook } from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook = {\r\n  run (event) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst logger = createLogger({\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyObjectsHook\r\n  ],\r\n  afterHooks: [\r\n    ServerLogHook\r\n  ]\r\n})\r\n\r\nexport default logger\r\n```\r\n**`logger/index.ts`** (TypeScript example, same functionality as above)\r\n```ts\r\nimport { createLogger, StringifyObjectsHook, LoggerHook, LogEvent } from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook: LoggerHook = {\r\n  run (event: LogEvent) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst options: LoggerOptions = {\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyObjectsHook\r\n  ],\r\n  afterHooks: [\r\n    ServerLogHook\r\n  ]\r\n}\r\n\r\nexport default logger\r\n```\r\n\r\n## Usage\r\n\r\n**Composition API**:  Import and use the ```useLogger``` method to inject the logger instance.\r\n\r\n```js\r\nimport { defineComponent } from 'vue'\r\nimport { useLogger } from 'vue-logger-plugin'\r\nexport default defineComponent({\r\n  name: 'MyComponent',\r\n  setup () {\r\n    const log = useLogger()\r\n    log.info('Setting up MyComponent...')\r\n    return {\r\n      log\r\n    }\r\n  },\r\n  // example logger usage from outside of setup method\r\n  methods: {\r\n    test() {\r\n      const testObject = {\r\n        name: 'test',\r\n        value: 'this is a test object'\r\n      }\r\n      this.log.debug('Test Message', testObject)\r\n      this.log.info('Test Message', testObject)\r\n      this.log.warn('Test Message', testObject)\r\n      this.log.error('Test Message', testObject)\r\n      this.log.log('Test Message', testObject)\r\n      // change options\r\n      this.log.apply({ level: 'error' }) // applies new log level\r\n      this.log.warn('This is not logged now')\r\n    }\r\n  }\r\n})\r\n```\r\n\r\nAs described in the Vue Plugin Install section above, options can be provided to the ```createLogger``` function for customizing the logging implementation.  As well, the logger options can be applied at any time to the logger on the Vue instance via the ```apply``` function (as demonstrated in the above example code).  This allows for on-demand enabling/disabling of the logger and adjusting log levels as needed from within your components.  Any options available to createLogger are also available to the apply function.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n[npm-image]: https://img.shields.io/npm/v/vue-logger-plugin.svg\r\n[npm-url]: https://npmjs.org/package/vue-logger-plugin\r\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\r\n[license-url]: LICENSE","readmeFilename":"README.md","gitHead":"9a457368e0e521dc59ae2e83b6157fd722334c2f","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@2.0.0-beta.0","_nodeVersion":"12.15.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-WD3l0PxAXWl2nK8NulWdPkFl0LvpfNsOoXFpoLnnL4PCDG+orugmrYOpG45LBUSquAgE6wqlYum9RRJcAh2nNA==","shasum":"091c5f118a281ca84083332b286ce7d08ee2f307","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-2.0.0-beta.0.tgz","fileCount":16,"unpackedSize":22940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfMJzoCRA9TVsSAnZWagAAqU0P/iUJ83Bi7KkPJVOyEiE6\no2qzx+Zpc8ZADxXIGipjRit1L0OaNRpZtVsXbn+7AnDb1xU3EWbU8hx9MA0g\nufbqgF4IjU0x59KMPlC4Gvyv5ufA8ZchEPT12MysGFl72y6wDXBJLSvyh+7f\nRsANRGDcoND1KUwWeFqwTs4UhKzThI8SNi3xoc+yO8hQ/KlPeALiUNMe18a+\nJ+7YTcuL579SZwy42W4HHJohVb8bknNiUh/ASvNfaO4CD+qSN6uT1VEhiIC6\nYEMUdXOL1YA3MxC6a7EOejhGXaPjtf2RiUzQ6dV5NspFiUAmflNk/7hQEXXq\nnWBUVTnKuTizAJaIR/jX2zOOdn6wEQW1B6Paq8ibmS9nfjF/pOxnpVtcCxHV\nXrPYVMwRYi1jF0lLlOt5XhucvuXLdix2Jj1DfNPyN0uRsbI2N3zBuPsviawL\nYWuE0Ye+aV3zRmegVUxZOENfxdeNhlPK595WTAF/ZVym86ByziBT2W/W7IVB\nfuwd7kP/q6xtBYqhnRfP9Q2BHjKV7ruMDEVTRVPNIJjVnpeYRwU9Mx36k+Fu\nYJnZNe28oZuLowSB7hORt6Z63WtubvAUXwA20uUn+gumrQ0RsP5U7DIFR7JA\nz9DtFvtmPVdijp8iz1jwNTk1KDm9mwbeNxowu3P0HKRKlf2uIrsIzfZqoPTc\nPAv+\r\n=2o/d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJgg079PBpJyCi2tYIGydw0KnSjDi0rQ00HZDKn+dohAIgfQk9t07eEG/pnRlEYUt8CLOxAhVonZ7Q2YyQdYBEDbU="}]},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_2.0.0-beta.0_1597021416222_0.7011878763063641"},"_hasShrinkwrap":false},"2.0.0-beta.1":{"name":"vue-logger-plugin","version":"2.0.0-beta.1","description":"Flexible logging functionality for Vue.js 2 & 3","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags"},"dependencies":{},"devDependencies":{"@types/jest":"^26.0.13","@types/node":"^14.10.1","jest":"^26.4.2","ts-jest":"^26.3.0","tslib":"^2.0.1","tslint":"^6.1.3","typescript":"^4.0.2","vue":"^3.0.0-rc.10"},"keywords":["vue","vue 2","vue 3","logger","logging"],"readme":"# vue-logger-plugin\r\n\r\n> Flexible logging functionality for Vue.js with support for custom hook operations.\r\n\r\n[![NPM Version][npm-image]][npm-url]\r\n[![License][license-image]][license-url]\r\n\r\n*Note:*\r\n*Versions 2.x support Vue 3 and versions 1.x support Vue 2.*\r\n*For documentation related to Vue 2, view a 1.x tag*\r\n\r\nContents\r\n=================\r\n* [NPM Package Install](#npm-package-install)\r\n* [Vue Plugin Install](#vue-plugin-install)\r\n* [Options](#options)\r\n* [Hooks](#hooks)\r\n    * [Built-in Hooks](#built-in-hooks)\r\n    * [Write Your Own Hooks](#write-your-own-hooks)\r\n* [Usage](#usage)\r\n* [License](#license)\r\n* [Changelog](CHANGELOG.md)\r\n\r\n## NPM Package Install\r\n\r\n```sh\r\nnpm i vue-logger-plugin\r\n```\r\n\r\n## Vue Plugin Install\r\n\r\nThe logging implementation can be installed by creating a logger instance using ```createlogger``` and providing that logger instance to the Vue ```App.use``` method.  \r\n\r\nHere is the simplest usage:\r\n\r\n**`main.js`**\r\n```js\r\nimport { createApp, h } from 'vue';\r\nimport { createLogger } from 'vue-logger-plugin'\r\nimport App from './App.vue'\r\ncreateApp({\r\n  render: () => h(App)\r\n})\r\n  .use((createLogger({}))\r\n  .mount('#app')\r\n```\r\n\r\nDoing the above will install the logger with the basic default options.\r\n\r\nFor advanced usage (i.e. using conditional options and hooks), it is recommended to export the constructed logger instance in a separate file and then import into your main file.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport { createLogger } from 'vue-logger-plugin'\r\n\r\n// create logger with options\r\nconst logger = createLogger({\r\n  enabled: true,\r\n  level: 'debug',\r\n  beforeHooks: [ ... ],\r\n  afterHooks: [ ... ]\r\n})\r\n\r\nexport default logger\r\n```\r\n**`main.js`**\r\n```js\r\n// ...\r\nimport logger from './logger'\r\ncreateApp({\r\n  render: () => h(App)\r\n})\r\n  .use(logger)\r\n  .mount('#app')\r\n```\r\n\r\nMore information about hooks can be found in the [Hooks](#Hooks) section.\r\n\r\n### Options\r\n*(default values shown)*\r\n```js\r\n{\r\n  enabled: true,    // {boolean} enable/disable logging\r\n  level: 'debug',   // {string} the logging level (one of: debug, info, warn, error)\r\n  beforeHooks: [],  // {LoggerHook[]} hooks invoked before a statement is logged, can be used to alter log arguments (use carefully)\r\n  afterHooks: []    // {LoggerHook[]} hooks invoked after a statement is logged\r\n}\r\n```\r\n\r\n### Hooks\r\n\r\nHooks allow for advanced customization of the logger implementation, providing operations to be run before and after logging is performed.  These are defined on options as ```beforeHooks``` and ```afterHooks```.\r\n\r\n##### beforeHooks\r\nInvoked before a statement is logged, can alter the log arguments which can impact the log output.\r\n\r\n##### afterHooks\r\nInvoked after a statement is logged, cannot impact the log output.\r\n\r\n#### Built-in Hooks\r\nThe following hooks are available in this package and can be used by simply importing and adding them to the beforeHooks and/or afterHooks arrays of your options.\r\n\r\n**`StringifyObjectsHook`**\r\nApplies JSON.stringify on all objects provided as arguments to a logging method.\r\n```js\r\nimport { createLogger, StringifyObjectsHook } from 'vue-logger-plugin'\r\nconst logger = createLogger({\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyObjectsHook\r\n  ]\r\n})\r\n```\r\n**`StringifyAndParseObjectsHook`**\r\nApplies JSON.stringify and JSON.parse on all objects provided as arguments to a logging method.\r\n```js\r\nimport { createLogger, StringifyAndParseObjectsHook } from 'vue-logger-plugin'\r\nconst logger = createLogger({\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyAndParseObjectsHook\r\n  ]\r\n})\r\n```\r\n\r\nThe above are best used as 'before hooks' as they may purposefully alter the log output.  This way you are sure you are seeing the value of an object at the moment you log it. Otherwise, many browsers provide a live view that constantly updates as values change.\r\n\r\n#### Write Your Own Hooks\r\n\r\nYou can easily write your own hooks to apply custom logic.  A hook must implement a ```run``` function to handle a log event (an object containing the log level and the array of arguments which were passed to the logging method), and may optionally implement an ```install``` function which is invoked during plugin installation (or at the time of logger options application - see [Usage](#usage) section).\r\n\r\nFor reference, here are the interfaces:\r\n```ts\r\nexport interface LoggerHook {\r\n  run (event: LogEvent): void\r\n  install? (options: LoggerOptions): void\r\n  props?: { [key: string]: any }\r\n}\r\nexport interface LogEvent {\r\n  level: string\r\n  argumentArray: any[]\r\n}\r\n```\r\n\r\n##### Sample Custom Hook - Leveraging Axios to Send Logs to Server\r\nThis is a basic example demonstrating how you could have the logger send log data to a server using an Axios client.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport { createLogger, StringifyObjectsHook } from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook = {\r\n  run (event) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst logger = createLogger({\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyObjectsHook\r\n  ],\r\n  afterHooks: [\r\n    ServerLogHook\r\n  ]\r\n})\r\n\r\nexport default logger\r\n```\r\n**`logger/index.ts`** (TypeScript example, same functionality as above)\r\n```ts\r\nimport { createLogger, StringifyObjectsHook, LoggerHook, LogEvent } from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook: LoggerHook = {\r\n  run (event: LogEvent) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst options: LoggerOptions = {\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyObjectsHook\r\n  ],\r\n  afterHooks: [\r\n    ServerLogHook\r\n  ]\r\n}\r\n\r\nexport default logger\r\n```\r\n\r\n## Usage\r\n\r\n**Composition API**:  Import and use the ```useLogger``` method to inject the logger instance.\r\n\r\n```js\r\nimport { defineComponent } from 'vue'\r\nimport { useLogger } from 'vue-logger-plugin'\r\nexport default defineComponent({\r\n  name: 'MyComponent',\r\n  setup () {\r\n    const log = useLogger()\r\n    log.info('Setting up MyComponent...')\r\n    return {\r\n      log\r\n    }\r\n  },\r\n  // example logger usage from outside of setup method\r\n  methods: {\r\n    test() {\r\n      const testObject = {\r\n        name: 'test',\r\n        value: 'this is a test object'\r\n      }\r\n      this.log.debug('Test Message', testObject)\r\n      this.log.info('Test Message', testObject)\r\n      this.log.warn('Test Message', testObject)\r\n      this.log.error('Test Message', testObject)\r\n      this.log.log('Test Message', testObject)\r\n      // change options\r\n      this.log.apply({ level: 'error' }) // applies new log level\r\n      this.log.warn('This is not logged now')\r\n    }\r\n  }\r\n})\r\n```\r\n\r\nAs described in the Vue Plugin Install section above, options can be provided to the ```createLogger``` function for customizing the logging implementation.  As well, the logger options can be applied at any time to the logger on the Vue instance via the ```apply``` function (as demonstrated in the above example code).  This allows for on-demand enabling/disabling of the logger and adjusting log levels as needed from within your components.  Any options available to createLogger are also available to the apply function.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n[npm-image]: https://img.shields.io/npm/v/vue-logger-plugin.svg\r\n[npm-url]: https://npmjs.org/package/vue-logger-plugin\r\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\r\n[license-url]: LICENSE","readmeFilename":"README.md","gitHead":"166b5290168e529983b5c4bd0b149e6a380ed291","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@2.0.0-beta.1","_nodeVersion":"12.15.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-nFriB1s2h+2oZ28RHJDGLqX9btR2e+cxWVfZh4dYq+zHCbanOy0MDF45dsLZGtrUbTTITyQcgWIYb9E+7J7a4w==","shasum":"57576cc67eda8538270c71741e938599014f5b6e","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-2.0.0-beta.1.tgz","fileCount":16,"unpackedSize":24122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW/b9CRA9TVsSAnZWagAAnE0P/0AdaLxrwyBwe65huBrJ\n32XEfFFdp0kMCO9D4/06m0rCpCH3ZDNiNWeJ9l2rwhj7cUDC7JhN/LuH1GCi\n6lU9PzeZLCwspW9Y2M3Q2zrB7f2yTEmmkZ9fA6lEPYOoJIhwRlDXceDLQ7Rw\n0lhFEi9/Zf6yoGw5VgY1/sV308OLSWRDDH04GDBv3i45y8HXLZHrhm995zTB\nnswHuPGW/+TD7iCcAt/H52V7la4hPulEKiZFZnwtYD8tSJeH0bS9HIprbvuE\nEwg6fatPdH1S05iIozZfIq7Atfld74PdoAxrG4gY9H4wTFWxZJoPUj8tj1vm\nM6ynRhCLRSzwWoPDIen03tvDq8xSVMj8yiKfPWr1VM4LbIzxpfC3kNox6gBJ\n5sCLhEBRBkK1eDUC+B8FGQcngd7PDAFUt6ycBg3Ue0VGOu7d46iKQgldNxvJ\n4lK/hiRJiDp56PXCqkYp7AtGe4gvraItw3AeVhcUsWIiv+9AgobYZ8q5JNlt\ndyumMZelqtL4ahLk67SDe5cFh2iIP8TLqfK6x6mDs//dyJtshprHbBVYhw7e\n5ABSwEJVnOQymY9u5IMDllHYTEYiVBopKcAIO5pHNwglfkAhwRyag6Ig12Dy\nM3kifyBuKzMCZ+4fzKUsvjKwrab9hxLIvgAUDebfC3p0AnOj7KY/R7+NFysD\nhULO\r\n=zvxH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEncaJ1MoTKHCSZLjxDQA88j/si0kinL76XTceEon+38AiBOLQkEemKe3Rx85oMd1UxfmNEPiNFRV3Qk2wz81OQnzQ=="}]},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_2.0.0-beta.1_1599862525240_0.8935364166573094"},"_hasShrinkwrap":false},"2.0.0":{"name":"vue-logger-plugin","version":"2.0.0","description":"Flexible logging functionality for Vue.js 2 & 3","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags"},"dependencies":{},"devDependencies":{"@types/jest":"^26.0.14","@types/node":"^14.11.1","jest":"^26.4.2","ts-jest":"^26.4.0","tslib":"^2.0.1","tslint":"^6.1.3","typescript":"^4.0.3","vue":"^3.0.0"},"keywords":["vue","vue 2","vue 3","logger","logging"],"gitHead":"f49e1521455fd7a80c22e65e33921e74064b0d1c","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@2.0.0","_nodeVersion":"12.15.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-Yfp9sGm9kWwe89kh3dqW1//GmXx6nLI/ohJrKgHje4VzSTzz8zaML53uu4O5D0D+XdIr9g8Yt+nlaZvWZV7pDA==","shasum":"f454b3f3138df53030417dd6dc41187a8f7c1acc","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-2.0.0.tgz","fileCount":14,"unpackedSize":25036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaBhfCRA9TVsSAnZWagAAhPIP/iJn+MphZxxm8PuL52Kq\nai4CFW+oPylicwGW+8mMY6K9TAHHpNGdfKeO+mPYFZuCDiBVpfGQZ1N4FtIA\nib8P+J/AVyhsH4DsUsCKyMn/ymJZIlFVC0cZ6LE2VgwIKFk707hgBeBDOHz/\nQjf/thJXajm8YdoaN2tkdp8ryeY257jfXV4Hf2BEgoYYsviRDllL03b5Q5Ms\nkEAad3ImScm6KxCIvmHl8pPxnssYvmdQCPHKJTh+WK7FcegRd7OitKD7Pwih\nST1FLDV1mIezjVEULozTH6eGAIfHuY9b+8oFjfF2tpgRwL+9tXnxBvkRZs/q\n1Ff9lMyk2otB8yj4rh3XD+6OxI3/JDz/p33m3k8xtiG0wfz9QudlWmpJBVqv\nVk8xwRJInTb8VulhjE91ytCOXwtiYI6R1STxJZG/skYYR3zTKiVFVJ5CeQ5R\nOOzvIvXTwFy7hL/dz1eEMCzKeXREt8HaZAkYuUXrrNQIbl6s7YtpyrrHGUQh\nE3AcFMVBVKwnUq5rKo7fKudcFrgXE2yAutLRd9Soxb4qjGGgZ7gH0HO6p9ag\nPD0WK/FV679ZJuV0jCoZscPdc46qReXpXbRiYQcNhUJQmvRHfyx7K+cN+0O8\ni8X1MIofRudBkTEz6A1x+QYRs3MljMBfUXOdIzRm1s4hpSZfgt3Eqq2qOS/H\na8b0\r\n=6st2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbyQvCxQR6qy2s+nvzfVcMBYdM4Y5o2PrI8Z8Kfsq3qQIgQHKZiWoFcqzW50gPVzfff4sWuAYLbH3SLuOVWyAxk7c="}]},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_2.0.0_1600657502474_0.8334481432586258"},"_hasShrinkwrap":false},"1.1.0":{"name":"vue-logger-plugin","version":"1.1.0","description":"Flexible logging functionality for Vue.js","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"1.x-next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"dependencies":{},"devDependencies":{"@types/jest":"^25.1.4","@types/node":"^13.9.1","jest":"^25.1.0","ts-jest":"^25.2.1","tslib":"^1.11.1","tslint":"^6.1.0","typescript":"^3.8.3","vue":"^2.6.11"},"keywords":["vue","logger","logging"],"readme":"# vue-logger-plugin\n\n[![NPM Version][npm-image]][npm-url]\n[![License][license-image]][license-url]\n[![codecov][codecov-image]][codecov-url]\n[![circleci][circleci-image]][circleci-url]\n![minified][minified-image]\n![minzipped][minzipped-image]\n\n> Flexible logging functionality for Vue.js with support for custom hook operations.\n\nContents\n=================\n* [NPM Package Install](#npm-package-install)\n* [Vue Plugin Install](#vue-plugin-install)\n* [Options](#options)\n* [Hooks](#hooks)\n    * [Built-in Hooks](#built-in-hooks)\n    * [Write Your Own Hooks](#write-your-own-hooks)\n* [Usage](#usage)\n* [License](#license)\n* [Changelog](CHANGELOG.md)\n\n## NPM Package Install\n\n```sh\nnpm i vue-logger-plugin@1.x-latest\n```\n\n## Vue Plugin Install\n\nThe logging implementation can be installed a couple different ways, either by providing options or a constructed VueLogger instance to ```Vue.use```.  \n\nHere is the simplest usage:\n\n**`main.js`**\n```js\nimport VueLogger from 'vue-logger-plugin'\nVue.use(VueLogger, { <options here> })\n// or simply Vue.use(VueLogger) to just use the default options\n```\n\nFor advanced usage (i.e. using conditional options and hooks), it is recommended to export the constructed logger implementation in a separate file and then import into your main file.\n\n**`logger/index.js`**\n```js\nimport VueLogger from 'vue-logger-plugin'\n\n// define options\nconst options = {\n  enabled: true,\n  level: 'debug',\n  beforeHooks: [ ... ],\n  afterHooks: [ ... ]\n}\n\n// export logger with applied options\nexport default new VueLogger(options)\n```\n**`main.js`**\n```js\nimport logger from './logger'\nVue.use(logger)\n// note that you may also provide the options argument here as well\n// if provided, they would be merged with / override the options already applied\n```\n\nMore information about hooks can be found in the [Hooks](#Hooks) section.\n\n### Options\n\n**Name**|**Type**|**Default**|**Description**\n:-----|:-----|:-----|:-----\nenabled | boolean | true | enable/disable logger\nconsoleEnabled | boolean | true | enable/disable console output\nlevel | string | 'debug' | the logging level (one of: debug, info, warn, error, log)\nbeforeHooks | LoggerHook[] | [] | hooks invoked before a statement is logged, can be used to alter log arguments (use carefully)\nafterHooks | LoggerHook[] | [] | hooks invoked after a statement is logged\n\n**Levels**\n\nlog <-- error <-- warn <-- info <-- debug\n\n_(from left to right: least inclusive to most inclusive)_\n\nSpecify an appropriate level to limit the amount of information logged.  For example, using the 'warn' level will log the 'log', 'error', and 'warn' events but not the 'info' or 'debug' events.\n\n**enabled vs consoleEnabled**\n\nSetting `enabled` to false will disable all logger functionality (console output + hook invocations).\n\nSetting `consoleEnabled` to false will disable just the console output but will still invoke the hooks.\n\nSo, for example, if you want to prevent writing logs to the browser console but still invoke a hook (i.e. to send logs to a server) then you would set `enabled: true` and `consoleEnabled: false`.\n\n### Hooks\n\nHooks allow for advanced customization of the logger implementation, providing operations to be run before and after logging is performed.  These are defined on options as ```beforeHooks``` and ```afterHooks```.\n\n##### beforeHooks\nInvoked before a statement is logged, can alter the log arguments which can impact the log output.\n\n##### afterHooks\nInvoked after a statement is logged, cannot impact the log output.\n\n#### Built-in Hooks\nThe following hooks are available in this package and can be used by simply importing and adding them to the beforeHooks and/or afterHooks arrays of your options.\n\n**`StringifyObjectsHook`**\nApplies JSON.stringify on all objects provided as arguments to a logging method.\n```js\nimport { StringifyObjectsHook } from 'vue-logger-plugin'\nconst options = {\n  // ... (other options)\n  beforeHooks: [\n    StringifyObjectsHook\n  ]\n}\n```\n**`StringifyAndParseObjectsHook`**\nApplies JSON.stringify and JSON.parse on all objects provided as arguments to a logging method.\n```js\nimport { StringifyAndParseObjectsHook } from 'vue-logger-plugin'\nconst options = {\n  // ... (other options)\n  beforeHooks: [\n    StringifyAndParseObjectsHook\n  ]\n}\n```\n\nThe above are best used as 'before hooks' as they may purposefully alter the log output.  This way you are sure you are seeing the value of an object at the moment you log it. Otherwise, many browsers provide a live view that constantly updates as values change.\n\n#### Write Your Own Hooks\n\nYou can easily write your own hooks to apply custom logic.  A hook must implement a ```run``` function to handle a log event (an object containing the log level and the array of arguments which were passed to the logging method), and may optionally implement an ```install``` function which is invoked during plugin installation (or at the time of logger options application - see [Usage](#usage) section).\n\nFor reference, here are the interfaces:\n```ts\nexport interface LoggerHook {\n  run (event: LogEvent): void\n  install? (options: LoggerOptions): void\n  props?: { [key: string]: any }\n}\nexport interface LogEvent {\n  level: string\n  argumentArray: any[]\n}\n```\n\n##### Sample Custom Hook - Leveraging Axios to Send Logs to Server\nThis is a basic example demonstrating how you could have the logger send log data to a server using an Axios client.\n\n**`logger/index.js`**\n```js\nimport VueLogger from 'vue-logger-plugin'\nimport axios from 'axios'\n\nconst ServerLogHook = {\n  run (event) {\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\n  }\n}\n\nconst options = {\n  // ... (other options)\n  afterHooks: [\n    ServerLogHook\n  ]\n}\n\nexport default new VueLogger(options)\n```\n**`logger/index.ts`** (TypeScript example, same functionality as above)\n```ts\nimport VueLogger, { LoggerOptions, LoggerHook, LogEvent } from 'vue-logger-plugin'\nimport axios from 'axios'\n\nconst ServerLogHook: LoggerHook = {\n  run (event: LogEvent) {\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\n  }\n}\n\nconst options: LoggerOptions = {\n  // ... (other options)\n  afterHooks: [\n    ServerLogHook\n  ]\n}\n\nexport default new VueLogger(options)\n```\n\n## Usage\n\nOnce installed, the logger is available within the Vue instance via both ```$log``` and ```$logger``` (both access the same logger instance and provide the same functionality).\n\n```js\nnew Vue({\n  created: function() {\n    const testObject = {\n      name: 'test',\n      value: 'this is a test object'\n    }\n    // using $log\n    this.$log.debug('Test Message', testObject)\n    this.$log.info('Test Message', testObject)\n    this.$log.warn('Test Message', testObject)\n    this.$log.error('Test Message', testObject)\n    this.$log.log('Test Message', testObject)\n    // using $logger\n    this.$logger.debug('Test Message', testObject)\n    this.$logger.info('Test Message', testObject)\n    this.$logger.warn('Test Message', testObject)\n    this.$logger.error('Test Message', testObject)\n    this.$logger.log('Test Message', testObject)\n  }\n})\n```\n\nAs described in the Vue Plugin Install section above, options can be provided to the VueLogger constructor and/or to the Vue.use method for customizing the logging implementation.  As well, options can be applied at any time to the logger on the Vue instance via the ```apply``` method.  This allows for on-demand enabling/disabling of the logger and adjusting log levels as needed from within your components.\n\n```js\nthis.$log.apply({ level: 'info' }) // applies log level\n```\n\n```js\nthis.$log.apply({ enabled: false }) // disables logging\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n[npm-image]: https://img.shields.io/npm/v/vue-logger-plugin/1.x-latest.svg\n[npm-url]: https://npmjs.org/package/vue-logger-plugin\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\n[license-url]: LICENSE\n[codecov-image]: https://codecov.io/gh/dev-tavern/vue-logger-plugin/branch/develop-v1/graph/badge.svg?token=WZDGBNBIW5\n[codecov-url]: https://codecov.io/gh/dev-tavern/vue-logger-plugin\n[circleci-image]: https://circleci.com/gh/dev-tavern/vue-logger-plugin/tree/develop-v1.svg?style=svg\n[circleci-url]: https://circleci.com/gh/dev-tavern/vue-logger-plugin?branch=develop-v1\n[minified-image]: https://badgen.net/bundlephobia/min/vue-logger-plugin@1.x-latest\n[minzipped-image]: https://badgen.net/bundlephobia/minzip/vue-logger-plugin@1.x-latest","readmeFilename":"README.md","gitHead":"fa4b182f176aef59c6d47360a879503cb00a62f7","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@1.1.0","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"integrity":"sha512-tSc4/CFLHczodga6MTY8dEWSCeHK9pdI/tsb7vBd54OJusPLCgXG58VN/DA96hLCl/QLU8Fl3H3iS2vIP4AVlg==","shasum":"4a0345d1d842c4cc69d7fa46106899188d2a3941","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-1.1.0.tgz","fileCount":16,"unpackedSize":27242,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjg7ACRA9TVsSAnZWagAAkwkP/3Lw6ee8+4YnhuoK1e8S\n0DeqvBZIJdfVgfQmQKmYIdokE2kZsM4cJnCOMq3cnDIJgQkbAJJVgbe/wohR\nTNyXxZN3K/iQSAvWajxl2BunTNOjzCaPFQHM5pEiW4qyD6MOlpr2SX3Qmdk6\ntjmWBGC9/PekAYzyX6TArJPyXqdZ7qQrx7bPlYirOtOcf4pMYWwRYgTFvjfg\nPirVRaKYfFSbF5BfEKz5nQ4Z3/E7z1SNdR3klSAPO6tuAsNYQYvP+zoXQgQY\n9goREwBES5+A2CzzGedCWuz63sPVoZ64sOUx9PyAsOLvjkvzevwtoyXdo7lR\n9KSFpEBZCY7VqcoQvdpTBGzL5EN8+NBgA+7ufGyMzrPGxul2HSTcxrLSd9PQ\ng5HSAhAjgZfYo1hdsQ5lE1WergGqcNUvITyt6UhWpOYq8osXeVFry4L01AuW\nARwyaXHrqcGI8Eccgc4m9mTW1Bcf3YTe06En7K0jkniSQ4943aqd0TybPyIw\nQjavQ8Lt1sqelkPcl1sy5b7+wzCDmFfW7BBZtCGRRhDtpp9VbQsj6iCNIjz7\niCOQ+aIoTqpnOJrBpdg48hCOvYgJz+cTIThBaNqmKzkjYRsOutpP+uqBLm8j\neSgQM5k8Y1qz4CJpEgOK5NfkMna7QoCCzaQ7TzK5LI0SafQZMUixK9RBOAmb\n9hil\r\n=Tf33\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvTBfgCK7+S8L1P4hDSpFVkRPYDngBhOSbWJ7H+P16egIgITpvBFUqPiAziSToBQoFqlckTUsk+44ovbtfNYbYaZA="}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_1.1.0_1619922623824_0.3826987417055159"},"_hasShrinkwrap":false},"2.1.0":{"name":"vue-logger-plugin","version":"2.1.0","description":"Flexible logging functionality for Vue.js 2 & 3","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"dependencies":{},"devDependencies":{"@types/jest":"^26.0.14","@types/node":"^14.11.1","jest":"^26.4.2","ts-jest":"^26.4.0","tslib":"^2.0.1","tslint":"^6.1.3","typescript":"^4.0.3","vue":"^3.0.0"},"keywords":["vue","vue 2","vue 3","logger","logging"],"gitHead":"55b5c7b34d646bb5a9678f22510fc79db6c85a55","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@2.1.0","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"integrity":"sha512-835HlBrGonh3KWWH6vYqYUemZe/6KMLZMXI4aVnfuJxaAFVTyK0mUiCz3ahbz4MB6Yd92+vUe7GdVKWetWk4Qw==","shasum":"0ed7485ec22c8ce244709fb77acf58dbf0b73e4e","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-2.1.0.tgz","fileCount":16,"unpackedSize":27754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjhJGCRA9TVsSAnZWagAApk4P/0sYKVbLqczUToA+Tjki\nLOg1ZfHctwSEqqVpBA6K6qwZzK3QL1H4YoNS44cgldXM4q8+SOUS1DRkGCJQ\nW3jLXiwTkc9WR7KfSxBQ2yHgaCLuXtxUAhHw7hF8Oh1t8WXQA2Fwpg++nXrr\n414z0bfJA7uEczZO5HcvBonDDLQIyAlyROqJ9qyl8jchowNPq9yNQFDJlJsO\n1UZRWWAZpx21Rvt5wwXO3kOxf/xwHbh4Jja5Nk9tQrxuFBxPAnxgYlds3aTq\nptZprFitZ3/4UWdVbK+jSXuuawioySnIlHvNkPSHnH2MHHsYVjGM4qSEInFZ\nmlesHOPu6V2ENQvM/NbokXJX065jdhoyJ0qVDQ4l1sgix8i03q3hkxeNfRO7\n8fy7FMy7zELTMoSK/QYkuIgWq5Rk83ron306bmKx3HH2e6NozeGqAAx9HExC\nzAk1wo1HZ2+m0FAilicc1sTS3j7YZWFJcw7EvFxPRsp206RcTKY8XuGfHFC/\nKUK/lwbM4yUnvJYuR9341LlPAdd4WiGGw/reYRsjlqQT8n9/lxFjpu4IV53y\nWM8wK8ecGRz95sA32bu0GTYKKiPP72jiQD/pHOVznDLbPJCwTRwgX1oeqMjW\nN+Y38YJVylWGpdayoQIPBk4t0hhSO+1WcpLfnqcgmwTNQ0DLllHIvi+ITXJr\n87ly\r\n=/nsB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDyBkMZ/ewEq9BBJexBOgQVA0glibTmKujI8sJaNyzoJAiEA3matkkktcupGkcsc67yVWq0iJ4KakvpCg+nOjHl/oBw="}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_2.1.0_1619923525717_0.7494525803494523"},"_hasShrinkwrap":false},"2.1.1":{"name":"vue-logger-plugin","version":"2.1.1","description":"Flexible logging functionality for Vue.js 2 & 3","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"dependencies":{},"devDependencies":{"@types/jest":"^26.0.14","@types/node":"^14.11.1","jest":"^26.4.2","ts-jest":"^26.4.0","tslib":"^2.0.1","tslint":"^6.1.3","typescript":"^4.0.3","vue":"^3.0.0"},"keywords":["vue","vue 2","vue 3","logger","logging"],"gitHead":"631d5093f162ae769335ea164d31f34914687edb","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@2.1.1","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"integrity":"sha512-jCbywC3hgbEC33gF33RT8hrma4eE0q+Bf68XVMBvA8IsOiaguFsioAlA3ddqrjCZ2spDZLQ4LkhU/kpf7KRjBA==","shasum":"89bbf738a1dbe2c12808f7ec396b6118fcc920cf","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-2.1.1.tgz","fileCount":16,"unpackedSize":27890,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgke0VCRA9TVsSAnZWagAA1iAP/3Uwj40TQA7AyEe7WwRY\nCGv+4W8RNS0LbVUc1V3ghFcoLzlDoyuan5S7bF3mGyGkPZiIO3KIqpZp2mP2\njiKDGEHMwRMnTsRRDF+AB/eX0fzHgGma93+e+4uxnGyaZ9rYhsIBU4qA14vT\nn2bP0qTzlnjXC0wy3slcWtVleN9wuiDbEeTXE5/fpVdzCayOXwXlIK1eAeR6\nEJK9O/20Y3RWSktMGOjQZycnFlyUCcfy9XK61csu9lqX/bu0SaK1K9/c4bPo\nJodr8LX47Ecwc+H/BEQ+gG/MOQmnVuWBSgLCrXErzc6fioooUMQPn2nFfgM4\nzt4S4VioplYF4pjLFBGTDAOOYnFkkeFyXaPzfTyjiPVuy57Y/aux0Okq4/pe\nTifMq0YMkbfIrTdNDg88YjeWgehMGBycvr7RdrADJPJCxtzxqJA6Lfh8QO6L\nd7QhpzI5nAbiLwCXtoQx+jKqUQWOmVI/NUUNVGRh+yg4AtTAuIuZt7ipWgw8\n9kTK6P5Yq4W8JqgbdsO2YBBNXNISjsuTwlsS6onlP7Sfrq4llRL/ktYLvHTd\nyPR/1R/0BiycW1pRbgWcp5bAkSCD3Hf7wk5Gd2sSyLnD+jE+wS8bWcDmLkp2\nNN0/mES1COlZe8nEzPgrVBu097HrZhnHpSNxwt4QYL+MPWiEhbnlLyPvlTw3\n8EBc\r\n=aQLu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHyeESj809MpQRymFUCXH1+FNU1oGcVVcDg1jkmnu2HZAiEAvtvnS8+fKXbjXRixbi/M62XS+uZqcnc2/EkoJgkhJmc="}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_2.1.1_1620176148915_0.10593126860565971"},"_hasShrinkwrap":false},"1.1.1":{"name":"vue-logger-plugin","version":"1.1.1","description":"Flexible logging functionality for Vue.js","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"1.x-next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"dependencies":{},"devDependencies":{"@types/jest":"^25.1.4","@types/node":"^13.9.1","jest":"^25.1.0","ts-jest":"^25.2.1","tslib":"^1.11.1","tslint":"^6.1.0","typescript":"^3.8.3","vue":"^2.6.11"},"keywords":["vue","logger","logging"],"readme":"# vue-logger-plugin\r\n\r\n[![NPM Version][npm-image]][npm-url]\r\n[![License][license-image]][license-url]\r\n[![codecov][codecov-image]][codecov-url]\r\n[![circleci][circleci-image]][circleci-url]\r\n![minified][minified-image]\r\n![minzipped][minzipped-image]\r\n\r\n> Flexible logging functionality for Vue.js with support for custom hook operations.\r\n\r\nContents\r\n=================\r\n* [NPM Package Install](#npm-package-install)\r\n* [Vue Plugin Install](#vue-plugin-install)\r\n* [Options](#options)\r\n* [Hooks](#hooks)\r\n    * [Built-in Hooks](#built-in-hooks)\r\n    * [Write Your Own Hooks](#write-your-own-hooks)\r\n* [Usage](#usage)\r\n* [License](#license)\r\n* [Changelog](CHANGELOG.md)\r\n\r\n## NPM Package Install\r\n\r\n```sh\r\nnpm i vue-logger-plugin@1.x-latest\r\n```\r\n\r\n## Vue Plugin Install\r\n\r\nThe logging implementation can be installed a couple different ways, either by providing options or a constructed VueLogger instance to ```Vue.use```.  \r\n\r\nHere is the simplest usage:\r\n\r\n**`main.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\nVue.use(VueLogger, { <options here> })\r\n// or simply Vue.use(VueLogger) to just use the default options\r\n```\r\n\r\nFor advanced usage (i.e. using conditional options and hooks), it is recommended to export the constructed logger implementation in a separate file and then import into your main file.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\n\r\n// define options\r\nconst options = {\r\n  enabled: true,\r\n  level: 'debug',\r\n  beforeHooks: [ ... ],\r\n  afterHooks: [ ... ]\r\n}\r\n\r\n// export logger with applied options\r\nexport default new VueLogger(options)\r\n```\r\n**`main.js`**\r\n```js\r\nimport logger from './logger'\r\nVue.use(logger)\r\n// note that you may also provide the options argument here as well\r\n// if provided, they would be merged with / override the options already applied\r\n```\r\n\r\nMore information about hooks can be found in the [Hooks](#Hooks) section.\r\n\r\n### Options\r\n\r\n**Name**|**Type**|**Default**|**Description**\r\n:-----|:-----|:-----|:-----\r\nenabled | boolean | true | enable/disable logger\r\nconsoleEnabled | boolean | true | enable/disable console output\r\nlevel | string | 'debug' | the logging level (one of: debug, info, warn, error, log)\r\nbeforeHooks | LoggerHook[] | [] | hooks invoked before a statement is logged, can be used to alter log arguments (use carefully)\r\nafterHooks | LoggerHook[] | [] | hooks invoked after a statement is logged\r\n\r\n**Levels**\r\n\r\nlog <-- error <-- warn <-- info <-- debug\r\n\r\n_(from left to right: least inclusive to most inclusive)_\r\n\r\nSpecify an appropriate level to limit the amount of information logged.  For example, using the 'warn' level will log the 'log', 'error', and 'warn' events but not the 'info' or 'debug' events.\r\n\r\n**enabled vs consoleEnabled**\r\n\r\nSetting `enabled` to false will disable all logger functionality (console output + hook invocations).\r\n\r\nSetting `consoleEnabled` to false will disable just the console output but will still invoke the hooks.\r\n\r\nSo, for example, if you want to prevent writing logs to the browser console but still invoke a hook (i.e. to send logs to a server) then you would set `enabled: true` and `consoleEnabled: false`.\r\n\r\n### Hooks\r\n\r\nHooks allow for advanced customization of the logger implementation, providing operations to be run before and after logging is performed.  These are defined on options as ```beforeHooks``` and ```afterHooks```.\r\n\r\n##### beforeHooks\r\nInvoked before a statement is logged, can alter the log arguments which can impact the log output.\r\n\r\n##### afterHooks\r\nInvoked after a statement is logged, cannot impact the log output.\r\n\r\n#### Built-in Hooks\r\nThe following hooks are available in this package and can be used by simply importing and adding them to the beforeHooks and/or afterHooks arrays of your options.\r\n\r\n**`StringifyObjectsHook`**\r\nApplies JSON.stringify on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyObjectsHook\r\n  ]\r\n}\r\n```\r\n**`StringifyAndParseObjectsHook`**\r\nApplies JSON.stringify and JSON.parse on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyAndParseObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyAndParseObjectsHook\r\n  ]\r\n}\r\n```\r\n\r\nThe above are best used as 'before hooks' as they may purposefully alter the log output.  This way you are sure you are seeing the value of an object at the moment you log it. Otherwise, many browsers provide a live view that constantly updates as values change.\r\n\r\n#### Write Your Own Hooks\r\n\r\nYou can easily write your own hooks to apply custom logic.  A hook must implement a ```run``` function to handle a log event (an object containing the log level and the array of arguments which were passed to the logging method), and may optionally implement an ```install``` function which is invoked during plugin installation (or at the time of logger options application - see [Usage](#usage) section).\r\n\r\nFor reference, here are the interfaces:\r\n```ts\r\nexport interface LoggerHook {\r\n  run (event: LogEvent): void\r\n  install? (options: LoggerOptions): void\r\n  props?: { [key: string]: any }\r\n}\r\nexport interface LogEvent {\r\n  level: string\r\n  argumentArray: any[]\r\n}\r\n```\r\n\r\n##### Sample Custom Hook - Leveraging Axios to Send Logs to Server\r\nThis is a basic example demonstrating how you could have the logger send log data to a server using an Axios client.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook = {\r\n  run (event) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst options = {\r\n  // ... (other options)\r\n  afterHooks: [\r\n    ServerLogHook\r\n  ]\r\n}\r\n\r\nexport default new VueLogger(options)\r\n```\r\n**`logger/index.ts`** (TypeScript example, same functionality as above)\r\n```ts\r\nimport VueLogger, { LoggerOptions, LoggerHook, LogEvent } from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook: LoggerHook = {\r\n  run (event: LogEvent) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst options: LoggerOptions = {\r\n  // ... (other options)\r\n  afterHooks: [\r\n    ServerLogHook\r\n  ]\r\n}\r\n\r\nexport default new VueLogger(options)\r\n```\r\n\r\n## Usage\r\n\r\nOnce installed, the logger is available within the Vue instance via both ```$log``` and ```$logger``` (both access the same logger instance and provide the same functionality).\r\n\r\n```js\r\nnew Vue({\r\n  created: function() {\r\n    const testObject = {\r\n      name: 'test',\r\n      value: 'this is a test object'\r\n    }\r\n    // using $log\r\n    this.$log.debug('Test Message', testObject)\r\n    this.$log.info('Test Message', testObject)\r\n    this.$log.warn('Test Message', testObject)\r\n    this.$log.error('Test Message', testObject)\r\n    this.$log.log('Test Message', testObject)\r\n    // using $logger\r\n    this.$logger.debug('Test Message', testObject)\r\n    this.$logger.info('Test Message', testObject)\r\n    this.$logger.warn('Test Message', testObject)\r\n    this.$logger.error('Test Message', testObject)\r\n    this.$logger.log('Test Message', testObject)\r\n  }\r\n})\r\n```\r\n\r\nAs described in the Vue Plugin Install section above, options can be provided to the VueLogger constructor and/or to the Vue.use method for customizing the logging implementation.  As well, options can be applied at any time to the logger on the Vue instance via the ```apply``` method.  This allows for on-demand enabling/disabling of the logger and adjusting log levels as needed from within your components.\r\n\r\n```js\r\nthis.$log.apply({ level: 'info' }) // applies log level\r\n```\r\n\r\n```js\r\nthis.$log.apply({ enabled: false }) // disables logging\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n[npm-image]: https://img.shields.io/npm/v/vue-logger-plugin/1.x-latest.svg\r\n[npm-url]: https://npmjs.org/package/vue-logger-plugin\r\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\r\n[license-url]: LICENSE\r\n[codecov-image]: https://codecov.io/gh/dev-tavern/vue-logger-plugin/branch/develop-v1/graph/badge.svg?token=WZDGBNBIW5\r\n[codecov-url]: https://codecov.io/gh/dev-tavern/vue-logger-plugin\r\n[circleci-image]: https://circleci.com/gh/dev-tavern/vue-logger-plugin/tree/develop-v1.svg?style=svg\r\n[circleci-url]: https://circleci.com/gh/dev-tavern/vue-logger-plugin?branch=develop-v1\r\n[minified-image]: https://badgen.net/bundlephobia/min/vue-logger-plugin@1.x-latest\r\n[minzipped-image]: https://badgen.net/bundlephobia/minzip/vue-logger-plugin@1.x-latest","readmeFilename":"README.md","gitHead":"20bb1a334672b05eb0ef57f2266de5aa6c9a95ce","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@1.1.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-tHN7XA3YCtuu615U6mntWxb4pxanNyrNNSnrpfbMPd5iAwCx4rhaKjRTeofC235KEVL+wkTymR/yB5OCWe3u6w==","shasum":"14bc61898d418171bc2808f077e1586cff91c332","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-1.1.1.tgz","fileCount":16,"unpackedSize":28100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtGFJCRA9TVsSAnZWagAAjt8P/jbalm7r3P9aNr+ojL32\nx/mBIVpBEGAfUF/ZxBUYKB+w+9Am2N1yxxh7Spof7k3gB6D3wcs9Aqkd7pHR\nOlmPg+a2k/C6RHwnrQDM9NuU9kpEHZLvuY0JsGM/9jGxt6rR7mTdc8HDXIK8\nNnmFPgecxFm15+kKKKJ+ffYNEF/QWFOmyasQKUPKNeNXYm0qP/qJg6kpQwpu\nurK31aWPz5F7mo3Bd4M9RWWR5jQjVNvGQsW8sDonR59RoyDCBGqKczuO/tZi\nCwWKdvZH3OGvnVOgtrtfT7Ix3O9uObVfESdx+joNp4+zQXWRm4asPPdMjFV8\n2OBDlDnITpq7ErT1nz4BrrsOHNnDb0BjK5XcBvdKlcLJ+Sycmz2m8RCjXmBv\nJyOOnL8Il9LtSMLyhuS3CBeiXSNTJrc4ZAvQG+n+rbxaKNvkCEPgMzViCqIl\nsBl9X2tk1BjvQBkqWgDfVmZgoPJ32pHM11u9z/PIc21tI9SqIPXghW9VW73a\nh1XbvBqlbw8tVQaQ4K/ZbedmKYtOgDwnoEemfl1wBUvJv0VMnBagbnDeBFej\nkql+8GJOEaP+ngiCDcV+kx2rzx1N+/r1djxtljLsX5IBRwdQrVvFom/zi4M1\n6BDukuCNeK/uWS5NFUqmuNAAYiXsM6UQmADRLsV+ZwfPBLjTlRcx9U1AO3Zp\nxz3K\r\n=B3qN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE+u6mvXOwBnu3YVCaWyNkntIwbzevGs03LYZLabxGTRAiEA/xOua8xjkTBGLez+q+KtZyo/lIZguTY767sP9CM7TU0="}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_1.1.1_1622434121353_0.39630716592044446"},"_hasShrinkwrap":false},"2.1.2":{"name":"vue-logger-plugin","version":"2.1.2","description":"Flexible logging functionality for Vue.js 2 & 3","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"dependencies":{},"devDependencies":{"@types/jest":"^26.0.14","@types/node":"^14.11.1","jest":"^26.4.2","ts-jest":"^26.4.0","tslib":"^2.0.1","tslint":"^6.1.3","typescript":"^4.0.3","vue":"^3.0.0"},"keywords":["vue","vue 2","vue 3","logger","logging"],"gitHead":"7ca56b820ac330d9c71970e06d08f6e04c742f13","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@2.1.2","_nodeVersion":"14.15.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-gQ1z64pyVlaC4/HXDgCoj9reyJJB3aKPAGGw4fhJg5jHjAtCt6g/TFmjoaWJfvzyhGJCtaE62BfEz3VS5MlxXA==","shasum":"3b5ffd446e12cc0923c6cb1dbddc05de63103826","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-2.1.2.tgz","fileCount":14,"unpackedSize":27606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtGH/CRA9TVsSAnZWagAAdJUP/iVzBROLttFdXKkbLFBq\nmRXLu/6t/9vrufIdWpTTBeBoc/sUuFzvmjAnr3oZQYLXwj3IsV/V/hbhOeQa\nqXSi4dM/AayIQIpitgO1jiLM6VDHYKk5cquV+gox4cyetG/VSHR+4o1RosI5\n7djBkbkL2ZQ0fRF1TiMx1j+BfcFSxSQ51hber9DvvYW0FRlK3rvaPKyuoeaJ\nUgXE/1hK4bDjkZn6J8Hj7AYufbfPmwhERwJ0B88Q923epIvg1s9wSC4dqVHM\ndQj94KyrbDMdftu/xX+U3S834SnTwbHf8LsOTaMR0ZwFWenx1WmmoURtAMPM\nFH1Hpg+fGUa/UmXbh6yesuScU2j9BqyHbEqrf6vj4jwCvYijMUMmS5ACq/Pl\nVaSpvUj+a3fb3bZRhi2cyW3z9KV3BD2U3zWipdDzqAdsCpwkVDE0XkniIWJz\na7Js0n9UK0mzQ303Rfg4EeR3aIJokfsCdYc4FX8QmbjVYFa7sOwNJHiaC8S/\nwbMPc8Ua7VZC5fSidSLbzoUBR5ysnDLVLrLqK31mERs3xKHYQqJ9pyUQJzut\nsnl2HRXDGNBI2XsQzylbDMvxYUlNlLi3J+4UeJ8l7KByeVAYycblF9BiL7HT\nUHljuVkskkpKL0KzEQfz5GvrQ6rf0B/a7w5H4lI3ib6FmX9nR/NVIIvoj0fC\nWhpr\r\n=FA24\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAyRfatxYzSFdLS7jgRvpY6j+v98DaCx6yh20YoVcFlgIgH/sNcY+TjkpRD7IvtIQAClUGmO8VwlJUYY1GA4AYHiw="}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_2.1.2_1622434302975_0.9388443406338183"},"_hasShrinkwrap":false},"1.1.2":{"name":"vue-logger-plugin","version":"1.1.2","description":"Flexible logging functionality for Vue.js","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"1.x-next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"dependencies":{},"devDependencies":{"@types/jest":"^25.1.4","@types/node":"^13.9.1","jest":"^25.1.0","ts-jest":"^25.2.1","tslib":"^1.11.1","tslint":"^6.1.0","typescript":"^3.8.3","vue":"^2.6.11"},"keywords":["vue","logger","logging"],"readme":"# vue-logger-plugin\r\n\r\n[![NPM Version][npm-image]][npm-url]\r\n[![License][license-image]][license-url]\r\n[![codecov][codecov-image]][codecov-url]\r\n[![circleci][circleci-image]][circleci-url]\r\n![minified][minified-image]\r\n![minzipped][minzipped-image]\r\n\r\n> Flexible logging functionality for Vue.js with support for custom hook operations.\r\n\r\nContents\r\n=================\r\n* [NPM Package Install](#npm-package-install)\r\n* [Vue Plugin Install](#vue-plugin-install)\r\n* [Options](#options)\r\n* [Hooks](#hooks)\r\n    * [Built-in Hooks](#built-in-hooks)\r\n    * [Write Your Own Hooks](#write-your-own-hooks)\r\n* [Usage](#usage)\r\n* [License](#license)\r\n* [Changelog](CHANGELOG.md)\r\n\r\n## NPM Package Install\r\n\r\n```sh\r\nnpm i vue-logger-plugin@1.x-latest\r\n```\r\n\r\n## Vue Plugin Install\r\n\r\nThe logging implementation can be installed a couple different ways, either by providing options or a constructed VueLogger instance to ```Vue.use```.  \r\n\r\nHere is the simplest usage:\r\n\r\n**`main.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\nVue.use(VueLogger, { <options here> })\r\n// or simply Vue.use(VueLogger) to just use the default options\r\n```\r\n\r\nFor advanced usage (i.e. using conditional options and hooks), it is recommended to export the constructed logger implementation in a separate file and then import into your main file.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\n\r\n// define options\r\nconst options = {\r\n  enabled: true,\r\n  level: 'debug',\r\n  beforeHooks: [ ... ],\r\n  afterHooks: [ ... ]\r\n}\r\n\r\n// export logger with applied options\r\nexport default new VueLogger(options)\r\n```\r\n**`main.js`**\r\n```js\r\nimport logger from './logger'\r\nVue.use(logger)\r\n// note that you may also provide the options argument here as well\r\n// if provided, they would be merged with / override the options already applied\r\n```\r\n\r\nMore information about hooks can be found in the [Hooks](#Hooks) section.\r\n\r\n### Options\r\n\r\n**Name**|**Type**|**Default**|**Description**\r\n:-----|:-----|:-----|:-----\r\nenabled | boolean | true | enable/disable logger\r\nconsoleEnabled | boolean | true | enable/disable console output\r\nlevel | string | 'debug' | the logging level (one of: debug, info, warn, error, log)\r\nbeforeHooks | LoggerHook[] | [] | hooks invoked before a statement is logged, can be used to alter log arguments (use carefully)\r\nafterHooks | LoggerHook[] | [] | hooks invoked after a statement is logged\r\n\r\n**Levels**\r\n\r\nlog <-- error <-- warn <-- info <-- debug\r\n\r\n_(from left to right: least inclusive to most inclusive)_\r\n\r\nSpecify an appropriate level to limit the amount of information logged.  For example, using the 'warn' level will log the 'log', 'error', and 'warn' events but not the 'info' or 'debug' events.\r\n\r\n**enabled vs consoleEnabled**\r\n\r\nSetting `enabled` to false will disable all logger functionality (console output + hook invocations).\r\n\r\nSetting `consoleEnabled` to false will disable just the console output but will still invoke the hooks.\r\n\r\nSo, for example, if you want to prevent writing logs to the browser console but still invoke a hook (i.e. to send logs to a server) then you would set `enabled: true` and `consoleEnabled: false`.\r\n\r\n### Hooks\r\n\r\nHooks allow for advanced customization of the logger implementation, providing operations to be run before and after logging is performed.  These are defined on options as ```beforeHooks``` and ```afterHooks```.\r\n\r\n##### beforeHooks\r\nInvoked before a statement is logged, can alter the log arguments which can impact the log output.\r\n\r\n##### afterHooks\r\nInvoked after a statement is logged, cannot impact the log output.\r\n\r\n#### Built-in Hooks\r\nThe following hooks are available in this package and can be used by simply importing and adding them to the beforeHooks and/or afterHooks arrays of your options.\r\n\r\n**`StringifyObjectsHook`**\r\nApplies JSON.stringify on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyObjectsHook\r\n  ]\r\n}\r\n```\r\n**`StringifyAndParseObjectsHook`**\r\nApplies JSON.stringify and JSON.parse on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyAndParseObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyAndParseObjectsHook\r\n  ]\r\n}\r\n```\r\n\r\nThe above are best used as 'before hooks' as they may purposefully alter the log output.  This way you are sure you are seeing the value of an object at the moment you log it. Otherwise, many browsers provide a live view that constantly updates as values change.\r\n\r\n#### Write Your Own Hooks\r\n\r\nYou can easily write your own hooks to apply custom logic.  A hook must implement a ```run``` function to handle a log event (an object containing the log level and the array of arguments which were passed to the logging method), and may optionally implement an ```install``` function which is invoked during plugin installation (or at the time of logger options application - see [Usage](#usage) section).\r\n\r\nFor reference, here are the interfaces:\r\n```ts\r\nexport interface LoggerHook {\r\n  run (event: LogEvent): void\r\n  install? (options: LoggerOptions): void\r\n  props?: { [key: string]: any }\r\n}\r\nexport interface LogEvent {\r\n  level: string\r\n  argumentArray: any[]\r\n}\r\n```\r\n\r\n##### Sample Custom Hook - Leveraging Axios to Send Logs to Server\r\nThis is a basic example demonstrating how you could have the logger send log data to a server using an Axios client.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook = {\r\n  run (event) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst options = {\r\n  // ... (other options)\r\n  afterHooks: [\r\n    ServerLogHook\r\n  ]\r\n}\r\n\r\nexport default new VueLogger(options)\r\n```\r\n**`logger/index.ts`** (TypeScript example, same functionality as above)\r\n```ts\r\nimport VueLogger, { LoggerOptions, LoggerHook, LogEvent } from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook: LoggerHook = {\r\n  run (event: LogEvent) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst options: LoggerOptions = {\r\n  // ... (other options)\r\n  afterHooks: [\r\n    ServerLogHook\r\n  ]\r\n}\r\n\r\nexport default new VueLogger(options)\r\n```\r\n\r\n## Usage\r\n\r\nOnce installed, the logger is available within the Vue instance via both ```$log``` and ```$logger``` (both access the same logger instance and provide the same functionality).\r\n\r\n```js\r\nnew Vue({\r\n  created: function() {\r\n    const testObject = {\r\n      name: 'test',\r\n      value: 'this is a test object'\r\n    }\r\n    // using $log\r\n    this.$log.debug('Test Message', testObject)\r\n    this.$log.info('Test Message', testObject)\r\n    this.$log.warn('Test Message', testObject)\r\n    this.$log.error('Test Message', testObject)\r\n    this.$log.log('Test Message', testObject)\r\n    // using $logger\r\n    this.$logger.debug('Test Message', testObject)\r\n    this.$logger.info('Test Message', testObject)\r\n    this.$logger.warn('Test Message', testObject)\r\n    this.$logger.error('Test Message', testObject)\r\n    this.$logger.log('Test Message', testObject)\r\n  }\r\n})\r\n```\r\n\r\nAs described in the Vue Plugin Install section above, options can be provided to the VueLogger constructor and/or to the Vue.use method for customizing the logging implementation.  As well, options can be applied at any time to the logger on the Vue instance via the ```apply``` method.  This allows for on-demand enabling/disabling of the logger and adjusting log levels as needed from within your components.\r\n\r\n```js\r\nthis.$log.apply({ level: 'info' }) // applies log level\r\n```\r\n\r\n```js\r\nthis.$log.apply({ enabled: false }) // disables logging\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n[npm-image]: https://img.shields.io/npm/v/vue-logger-plugin/1.x-latest.svg\r\n[npm-url]: https://npmjs.org/package/vue-logger-plugin\r\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\r\n[license-url]: LICENSE\r\n[codecov-image]: https://codecov.io/gh/dev-tavern/vue-logger-plugin/branch/develop-v1/graph/badge.svg?token=WZDGBNBIW5\r\n[codecov-url]: https://codecov.io/gh/dev-tavern/vue-logger-plugin\r\n[circleci-image]: https://circleci.com/gh/dev-tavern/vue-logger-plugin/tree/develop-v1.svg?style=svg\r\n[circleci-url]: https://circleci.com/gh/dev-tavern/vue-logger-plugin?branch=develop-v1\r\n[minified-image]: https://badgen.net/bundlephobia/min/vue-logger-plugin@1.x-latest\r\n[minzipped-image]: https://badgen.net/bundlephobia/minzip/vue-logger-plugin@1.x-latest","readmeFilename":"README.md","gitHead":"0173797f9941f6e69022c66abbadeb208b88162a","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@1.1.2","_nodeVersion":"14.15.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-BcGZD1UjRxwLfIiUa7wTcZgRq7fSvvqjVhR0VflK74JtSr2Kwhm1Lw/EFoba0OblGz4IKe6bpyJbWDtPRRM4DQ==","shasum":"9b1a743d857fdc9093590b6b292e4d33f1fd1c03","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-1.1.2.tgz","fileCount":16,"unpackedSize":28251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGU+kCRA9TVsSAnZWagAAznkP/jiMyJZ+Vpp+yL1sroS7\nFfKsjbRciQrWozxlJCru9RMOb02mTqz22jILgusNvwo8lw/66MmRnoSqfLcC\nWdjuBpxc0xtwGcGdCf6rhk2kN3YNXhYr8jaPRK9EPn23mu59jqE+IdZIFNhJ\nlav2cKq2iUo7LVbij9wvx+GU8ArRleXHc1qOL+gZAcwh0K34o4w0q2DNBQH1\n4RfaAysnPUakMHQKMmsD+79E31gL1spgyib94cM/Buy5tQEZXsAcg23ngk9h\nMpNGPkYL1ugwSxxFiE66W4cmA9LD8syXMAAlYDePgBmZcOHl3mhlOgKv6COs\n7MgyEloD9etVTv8AInzFR2MhUSVTZLMGUpcFPflKzQi/2+8d7L2EEdVZ0ID8\nshMuq0peYB+NkIOw2F9IRoiE08I6BbdkDIukHRpJePzx7EE/2IiX+ORLxxFO\nx8Nb95J1d1/lZs1ICD2mpLUGqWOMTe48wKbR49yk4+3DixDe5SPhba5Kybvd\nWlq+fpjqWUeOJUDYeuGfmRMInYaTF6neMwoalaPn1sF2zLHDwk+YNzDpW7Ey\nn55Sk8eoBrbvtazAjVHMl25OjFh1WRKs3Bq3Aimi6W92k4KhbYEhKGt8eH9i\nzd2/zBMbDTLUnU1Onxgo2N1RpLQr3VG9nSG7uieE0Lz5LoZioBKYYWfb+Znj\nZX2S\r\n=/yYS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGoQHZIs+h24JflhOSlWT+31PKReiZdkUrjDRIP7D+9HAiBQOdIu2PhxRm5nHsp+CZk9zkBL0DKkGFXkPM9CBH80rQ=="}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_1.1.2_1629048740202_0.5340657248015068"},"_hasShrinkwrap":false},"2.1.3":{"name":"vue-logger-plugin","version":"2.1.3","description":"Flexible logging functionality for Vue.js 2 & 3","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"dependencies":{},"devDependencies":{"@types/jest":"^26.0.14","@types/node":"^14.11.1","jest":"^26.4.2","ts-jest":"^26.4.0","tslib":"^2.0.1","tslint":"^6.1.3","typescript":"^4.0.3","vue":"^3.0.0"},"keywords":["vue","vue 2","vue 3","logger","logging"],"gitHead":"903b32eb9dc9e8c8f49e59a9af2fde64b5d7206f","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@2.1.3","_nodeVersion":"14.15.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-dGJ0pi8o2a6GT8j5b5OKd2ROJGg5RTLOLD4h0fYPN7Rpa39XaecV3GE0TRbJubK+IcXqDAvRWs82YwSSXtPg8w==","shasum":"657293737140a36dd1b2cf6517ff6ca117ce060c","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-2.1.3.tgz","fileCount":14,"unpackedSize":27756,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGVPUCRA9TVsSAnZWagAASLUP/2PG/480ezzWpj1S/cD1\n4jy/ghYySxj1tgSHUwB8HEovyN+msY69ODGz42jyNYvyVJEkaHIcCnpjiJBU\nU5/SfJQPVOUEmiwrnMqu8eC1WLiR+JO6BXC9oK9mqF42lPHsehZMdxzxxCQ4\nszYMU1TDZAwpgrfmqznGJ478l8oLgUMrByjaSQOxMdvbD27UnEI9OJJFdgpz\nYgPU6I5ikwnovewbId9Od2vuJTMxl8w9ddJPKnOlB8yN1QEdhLJiFNVoXOQy\nhjEpbEb9cRV8cmRNlT6GqIfZ3glm15yEH4J04MLBFyjHnXJQtYI+oS48+RzP\ny3I/ffGqII0gG9LCff2Gd63sCF8SbRzQA5uJeBvbtUsxYbyLAFJEFspSye6M\nuCVaiPULEHQkVEPHndEcP2UFwiO2ZCsmIdnUvt8hpW30cBAXhMK9zowipu6T\n8cKL6Ln8wS4kpH3CdjlR6U+JyMsNDccKkqLYAmry7o0+ZNwz4REks9TIpVQy\najfcHvtn1hznxUDkbjAOuVNqE7mFCmrwV3QkgPd6YMNFLzaxkku9Pwwq9Aip\ncHvO7HlH+uTWmaSKluRVRk5YgFsk/kK+08hZN3Y3AbohKn5xAbGMDOK6De+a\nEJUmiVxPEkTA6nrh9KbMApBUyxtZ6JPDEUySrLyAiSSt5apyW6/tSR7TlHJy\nAORw\r\n=tBXG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsipn8Emp9USxH3VzUotQ2iH3C53zWpDyEVRWRhdX1IAIhAIOkhcv15eB58TB6KN2H9kryj+iwM+FoHFpq+I6Ja6QZ"}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_2.1.3_1629049812654_0.406526454911293"},"_hasShrinkwrap":false},"2.1.4":{"name":"vue-logger-plugin","version":"2.1.4","description":"Flexible logging functionality for Vue.js 2 & 3","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"dependencies":{},"devDependencies":{"@types/jest":"^26.0.14","@types/node":"^14.11.1","jest":"^26.4.2","ts-jest":"^26.4.0","tslib":"^2.0.1","tslint":"^6.1.3","typescript":"^4.0.3","vue":"^3.0.0"},"keywords":["vue","vue 2","vue 3","logger","logging"],"gitHead":"b2aceb6c48d73f62248f4d671d6c34c863654270","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@2.1.4","_nodeVersion":"16.9.1","_npmVersion":"7.24.0","dist":{"integrity":"sha512-HuYBBI1+ef5SB5bpfl72nwaTLhfwp34MZe9efU+2AszLzitUv2Viv0K4NjI5rAlhq+lTxY/THrkAL7J0MqMdsQ==","shasum":"ebf57535202f4d7c11aa3ab2b8523bc8e31bf8df","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-2.1.4.tgz","fileCount":13,"unpackedSize":25981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7251CRA9TVsSAnZWagAAJP8QAJuVazkOxQ8/Kkup8rCv\nch4o/hV7DYNHPjx5atH8RAfWh4yg8blQsewxSsC3KLV0GgTdztrgp3CVPUmg\nFRTiZZ8rqYbl1CwgLBfPkriiAbW8HyeEoqjIZBKoN57TwTfqlSmdPPIrBkAr\nPVA/jkGx8SID7wLA8Ce5GJwSdCpeBRmklnrGHGcfh09kgzVD/IRDXUMu/xgy\nIgXlQU3Sorh1OepZtVNKA9mqfBtttgRAI0dXPBeZANlmeRqPmBILriwl0mhh\nzgPJoyFZVIQEBCC1ED3ke3MUePNUORh3bY1jSDNx+o7DN1clgEhoFcRHSiTZ\nxN6IXln3bPrX0EliRROX58ry/Ru4yVkagmixVOp51gYylGB2hpJDOT2XxY4j\nrihzItPCZJndWL8jRG69lzrzWH+GndpvYuHlqDWa2Xc5YW70+4lPpXUokS52\nsUN2TdBhd3yub8IGTcVVpYf+irJYRChPeclUGkrs80g7WhqY9NJ5MGEb1ACt\nvUajCRDdWxiNqeWYV314Z5BQJ++J3+/JAT1rRXX37Rw09LPyIn1/Uh7HCKxM\nm5WrrR5eI7lZxfQoHOu2u6aGgNelXH6ZkUBVtbrR78z379gdciy+BS+DB4vV\nXdSCanML1Pm5VGc6oYNNSE6i1Oxn1WvppjA4eCv+/ANPH1GNZK3ruhYF2Yyt\ngbvu\r\n=yTTv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGqY8o6yqd214gJUBdAgAyNlNrXp11AYVFRkBQ1jeRufAiEAh0CWTg6rgBi7AupxTDt9vFhUIzCte3iEUxWVq6zQgPY="}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_2.1.4_1643081333048_0.4891190077640475"},"_hasShrinkwrap":false},"2.2.0":{"name":"vue-logger-plugin","version":"2.2.0","description":"Flexible logging functionality for Vue.js 2 & 3","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"eslint .","lint:fix":"eslint . --fix","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint:fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"devDependencies":{"@types/jest":"^26.0.14","@types/node":"^14.11.1","@typescript-eslint/eslint-plugin":"^5.10.2","@typescript-eslint/parser":"^5.10.2","eslint":"^8.8.0","jest":"^26.4.2","ts-jest":"^26.4.0","tslib":"^2.0.1","typescript":"^4.0.3","vue":"^3.0.0"},"keywords":["vue","vue 2","vue 3","logger","logging"],"readme":"# vue-logger-plugin\r\n\r\n[![NPM Version][npm-image]][npm-url]\r\n[![License][license-image]][license-url]\r\n[![codecov][codecov-image]][codecov-url]\r\n[![circleci][circleci-image]][circleci-url]\r\n![minified][minified-image]\r\n![minzipped][minzipped-image]\r\n\r\n> Flexible logging functionality for Vue.js with support for custom hook operations.\r\n\r\n*Note:*\r\n*Versions 2.x support Vue 3 and versions 1.x support Vue 2.*\r\n*For documentation related to Vue 2, view a 1.x tag*\r\n\r\nContents\r\n=================\r\n* [NPM Package Install](#npm-package-install)\r\n* [Vue Plugin Install](#vue-plugin-install)\r\n* [Options](#options)\r\n* [Hooks](#hooks)\r\n    * [Built-in Hooks](#built-in-hooks)\r\n    * [Write Your Own Hooks](#write-your-own-hooks)\r\n* [Usage](#usage)\r\n* [License](#license)\r\n* [Changelog](CHANGELOG.md)\r\n\r\n## NPM Package Install\r\n\r\n```sh\r\nnpm i vue-logger-plugin\r\n```\r\n\r\n## Vue Plugin Install\r\n\r\nThe logging implementation can be installed by creating a logger instance using ```createlogger``` and providing that logger instance to the Vue ```App.use``` method.  \r\n\r\nHere is the simplest usage:\r\n\r\n**`main.js`**\r\n```js\r\nimport { createApp } from 'vue';\r\nimport { createLogger } from 'vue-logger-plugin'\r\nimport App from './App.vue'\r\ncreateApp(App)\r\n  .use(createLogger())\r\n  .mount('#app')\r\n```\r\n\r\nDoing the above will install the logger with the basic default options.\r\n\r\nFor advanced usage (i.e. using conditional options and hooks), it is recommended to export the constructed logger instance in a separate file and then import into your main file.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport { createLogger } from 'vue-logger-plugin'\r\n\r\n// create logger with options\r\nconst logger = createLogger({\r\n  enabled: true,\r\n  level: 'debug',\r\n  beforeHooks: [ ... ],\r\n  afterHooks: [ ... ]\r\n})\r\n\r\nexport default logger\r\n```\r\n**`main.js`**\r\n```js\r\nimport { createApp } from 'vue'\r\nimport App from './App.vue'\r\nimport logger from './logger'\r\ncreateApp(App)\r\n  .use(logger)\r\n  .mount('#app')\r\n```\r\n\r\nMore information about hooks can be found in the [Hooks](#Hooks) section.\r\n\r\n## Options\r\n\r\n**Name**|**Type**|**Default**|**Description**\r\n:-----|:-----|:-----|:-----\r\nenabled | boolean | true | enable/disable logger\r\nconsoleEnabled | boolean | true | enable/disable console output\r\nlevel | string | 'debug' | the logging level (one of: debug, info, warn, error, log)\r\ncallerInfo | boolean | false | whether information about the caller function should be included\r\nprefixFormat | string | *(see [below](#prefixFormat))* | provide a custom formatted string for the log message prefix (preceeds the log arguments)\r\nbeforeHooks | LoggerHook[] | [] | hooks invoked before a statement is logged, can be used to alter log arguments (use carefully)\r\nafterHooks | LoggerHook[] | [] | hooks invoked after a statement is logged\r\n\r\n### **Levels**\r\n\r\nlog <-- error <-- warn <-- info <-- debug\r\n\r\n_(from left to right: least inclusive to most inclusive)_\r\n\r\nSpecify an appropriate level to limit the amount of information logged.  For example, using the 'warn' level will log the 'log', 'error', and 'warn' events but not the 'info' or 'debug' events.\r\n\r\n> Note: Depending on your browser, the debug level may be labeled as \"Verbose\" instead of \"Debug\".  Ensure this level is enabled if looking for debug logs in the browser console.  Chrome uses verbose for these logs, see docs [here](https://developer.chrome.com/docs/devtools/console/log/#browser).\r\n\r\n### **enabled vs consoleEnabled**\r\n\r\nSetting `enabled` to false will disable all logger functionality (console output + hook invocations).\r\n\r\nSetting `consoleEnabled` to false will disable just the console output but will still invoke the hooks.\r\n\r\nSo, for example, if you want to prevent writing logs to the browser console but still invoke a hook (i.e. to send logs to a server) then you would set `enabled: true` and `consoleEnabled: false`.\r\n\r\n### **callerInfo**\r\n\r\nSetting `callerInfo` to true will result in caller function information (fileName, functionName, lineNumber) being determined and included in the log, as well as being included in events provided to hooks, for each log function invocation.\r\n\r\n### **prefixFormat**\r\n\r\nUse the `prefixFormat` option to customize the message prefix (portion of log statement that appears before the arguments provided to the log function).\r\nThis can as well be used to inject additional information into the message prefix, such as timestamps or user identifiers for example.\r\n\r\nThe value of this option must be a function which accepts a partial LogEvent object and returns a string.  The provided LogEvent object contains only log `level` and `caller` information.\r\n\r\nThe default for this option is:\r\n```typescript\r\nprefixFormat: ({ level, caller }) => {\r\n  return caller\r\n    ? `${level} | ${caller.fileName}::${caller.functionName} | `\r\n    : `${level} | `\r\n}\r\n```\r\n\r\n## Hooks\r\n\r\nHooks allow for advanced customization of the logger implementation, providing operations to be run before and after logging is performed.  These are defined on options as ```beforeHooks``` and ```afterHooks```.\r\n\r\n> As of version 2.2.0, asynchronous & async/await support has been added, allowing for hooks which return a Promise from their `run` function.\r\n\r\n### beforeHooks\r\nInvoked before a statement is logged, can alter the log arguments which can impact the log output.\r\n\r\n### afterHooks\r\nInvoked after a statement is logged, cannot impact the log output.\r\n\r\n### Built-in Hooks\r\nThe following hooks are available in this package and can be used by simply importing and adding them to the beforeHooks and/or afterHooks arrays of your options.\r\n\r\n**`StringifyObjectsHook`**\r\nApplies JSON.stringify on all objects provided as arguments to a logging method.\r\n```js\r\nimport { createLogger, StringifyObjectsHook } from 'vue-logger-plugin'\r\nconst logger = createLogger({\r\n  // ... (other options)\r\n  beforeHooks: [ StringifyObjectsHook ]\r\n})\r\n```\r\n**`StringifyAndParseObjectsHook`**\r\nApplies JSON.stringify and JSON.parse on all objects provided as arguments to a logging method.\r\n```js\r\nimport { createLogger, StringifyAndParseObjectsHook } from 'vue-logger-plugin'\r\nconst logger = createLogger({\r\n  // ... (other options)\r\n  beforeHooks: [ StringifyAndParseObjectsHook ]\r\n})\r\n```\r\n\r\nThe above are best used as 'before hooks' as they may purposefully alter the log output.  This way you are sure you are seeing the value of an object at the moment you log it. Otherwise, many browsers provide a live view that constantly updates as values change.\r\n\r\n### Write Your Own Hooks\r\n\r\nYou can easily write your own hooks to apply custom logic.  A hook must implement a ```run``` function to handle a log event (an object containing the log level and the array of arguments which were passed to the logging method), and may optionally implement an ```install``` function which is invoked during plugin installation (or at the time of logger options application - see [Usage](#usage) section).\r\n\r\nFor reference, here are the interfaces:\r\n```ts\r\nexport interface LoggerHook {\r\n  run (event: LogEvent): void | Promise<void>\r\n  install? (options: LoggerOptions): void\r\n  props?: { [key: string]: any }\r\n}\r\nexport interface LogEvent {\r\n  level: LogLevel // 'debug' | 'info' | 'warn' | 'error' | 'log'\r\n  argumentArray: any[]\r\n  caller?: CallerInfo\r\n}\r\nexport interface CallerInfo {\r\n  fileName?: string\r\n  functionName?: string\r\n  lineNumber?: string\r\n}\r\n```\r\n\r\n#### Sample Custom Hook - Leveraging Axios to Send Logs to Server\r\nThis is a basic example demonstrating how you could have the logger send log data to a server using an Axios client.\r\n\r\n**`logger/index.ts`**\r\n```ts\r\nimport { createLogger, StringifyObjectsHook, LoggerHook, LogEvent } from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook: LoggerHook = {\r\n  run(event: LogEvent) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n  // example using async/await:\r\n  // async run(event: LogEvent) {\r\n  //   await axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  // }\r\n}\r\n\r\nconst options: LoggerOptions = {\r\n  // ... (other options)\r\n  beforeHooks: [ StringifyObjectsHook ],\r\n  afterHooks: [ ServerLogHook ]\r\n}\r\n\r\nexport default logger\r\n```\r\n\r\n## Usage\r\n\r\n**Options API**:  The logger instance will be available on global properties as `$log` and `$logger`.\r\n\r\n**Composition API**:  Import and use the ```useLogger``` method to inject the logger instance.\r\n\r\n```js\r\nimport { defineComponent } from 'vue'\r\nimport { useLogger } from 'vue-logger-plugin'\r\nexport default defineComponent({\r\n  // example using composition api\r\n  setup() {\r\n    const log = useLogger()\r\n    log.info('Setting up MyComponent...')\r\n    return {}\r\n  },\r\n  // example using options api\r\n  methods: {\r\n    test() {\r\n      const testObject = {\r\n        name: 'test',\r\n        value: 'this is a test object'\r\n      }\r\n      this.$log.debug('Test Message', testObject)\r\n      this.$log.info('Test Message', testObject)\r\n      this.$log.warn('Test Message', testObject)\r\n      this.$log.error('Test Message', testObject)\r\n      this.$log.log('Test Message', testObject)\r\n      // change options\r\n      this.$log.apply({ level: 'error' }) // applies new log level\r\n      this.$log.warn('This is not logged now')\r\n    }\r\n  }\r\n})\r\n```\r\n\r\nAs described in the Vue Plugin Install section above, options can be provided to the ```createLogger``` function for customizing the logging implementation.  As well, the logger options can be applied at any time to the logger on the Vue instance via the ```apply``` function (as demonstrated in the above example code).  This allows for on-demand enabling/disabling of the logger and adjusting log levels as needed from within your components.  Any options available to createLogger are also available to the apply function.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n[npm-image]: https://img.shields.io/npm/v/vue-logger-plugin.svg\r\n[npm-url]: https://npmjs.org/package/vue-logger-plugin\r\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\r\n[license-url]: LICENSE\r\n[codecov-image]: https://codecov.io/gh/dev-tavern/vue-logger-plugin/branch/master/graph/badge.svg?token=WZDGBNBIW5\r\n[codecov-url]: https://codecov.io/gh/dev-tavern/vue-logger-plugin\r\n[circleci-image]: https://circleci.com/gh/dev-tavern/vue-logger-plugin.svg?style=svg\r\n[circleci-url]: https://circleci.com/gh/dev-tavern/vue-logger-plugin\r\n[minified-image]: https://badgen.net/bundlephobia/min/vue-logger-plugin\r\n[minzipped-image]: https://badgen.net/bundlephobia/minzip/vue-logger-plugin\r\n","readmeFilename":"README.md","gitHead":"1e3fbe41098d46a41550ccb044a39baa038d43f9","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@2.2.0","_nodeVersion":"16.9.1","_npmVersion":"7.24.0","dist":{"integrity":"sha512-yV9F8iEaTtdbdB4WM5MLJK3Ke4fpLplRX1AqetXVqmo4pku+8LDsUiWSUL/iT1aNeVYIvwfmnaTmXEkZtE9Mgw==","shasum":"84145d22bd68ae71fe27573269a202d1fa97a0b0","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-2.2.0.tgz","fileCount":13,"unpackedSize":30859,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/yO8CRA9TVsSAnZWagAA/3cP/07jKKNcmTQ0mAiIujeq\nfa4Bdyy3/VGcImZmn1CeJ5trw0xveU7fB9BtmkOE2dESNbk1qjVJy6UOlZOg\nuCIYqQuM0BilA27HrTYwV7728gXuGiw1DoclrkNl01SllNtmoWWS5J/p0Ypd\nMlL4RRroW1wyey1GDWBTUxzYbVxVM11pX+Jma+e7ugB3aQrwGBSwyM6OkDns\nAcbsGS+zBH/I1unCyRVrbi5jGFcVzoYt+ljByrQ85JiRh0jNRJb78GCbuk3u\nZMbWFIMlvcdkpiO82wdkviDIC+kMnZxWlyppDY1o5PLbXXfhl74BWhEUZZOR\n7N+tHt1cneDrXB880yIEW7EXFP6Vtcg7Zx5xfnhiJ3jn2Hjng1+yOn14i5Vn\nNpb85f63OTBx841jQtoIlw0P1Xr3si02zKx3Ilgb7QwuhtLiPR7/JZwRwVPo\ncbqTNdMgyhRxFmwdGzH5zrWO+PDrLMwf1b1F7UPxIoEAuAEbO4gs01oktpmH\nWhbx8iZS822MFyi7Om9geDXUjmRFmvD3cTcTgzQW95gjiDGKRs3Z5AvS/SOA\neHzxcMlY6M5EQIb6rB7dikIErljFT5deN4egvoZQfQLXw74JF14vWw/flbJM\nvpnxVg/DmuKFjm/+f72ou4MzosEYqixy5SiO8RpLj1UwHdWjZLu64QEtZke0\nVaDp\r\n=Zc3+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIED5yHqcLe1sPDq4ZnvuqQA/mrJnz2iWtvNJKUsRUuqcAiEAzky7glceLdEB+MfM/j7eGVCdYNXWdFzaJA+aJBFQOxY="}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_2.2.0_1644110780673_0.33884334017463846"},"_hasShrinkwrap":false},"1.1.3":{"name":"vue-logger-plugin","version":"1.1.3","description":"Flexible logging functionality for Vue.js","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"1.x-next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"tslint 'src/**/*.{ts,tsx}'","lint-fix":"tslint --fix 'src/**/*.{ts,tsx}' -t verbose","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint-fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"dependencies":{},"devDependencies":{"@types/jest":"^25.1.4","@types/node":"^13.9.1","jest":"^25.1.0","ts-jest":"^25.2.1","tslib":"^1.11.1","tslint":"^6.1.0","typescript":"^3.8.3","vue":"^2.6.11"},"keywords":["vue","logger","logging"],"readme":"# vue-logger-plugin\r\n\r\n[![NPM Version][npm-image]][npm-url]\r\n[![License][license-image]][license-url]\r\n[![codecov][codecov-image]][codecov-url]\r\n[![circleci][circleci-image]][circleci-url]\r\n![minified][minified-image]\r\n![minzipped][minzipped-image]\r\n\r\n> Flexible logging functionality for Vue.js with support for custom hook operations.\r\n\r\nContents\r\n=================\r\n* [NPM Package Install](#npm-package-install)\r\n* [Vue Plugin Install](#vue-plugin-install)\r\n* [Options](#options)\r\n* [Hooks](#hooks)\r\n    * [Built-in Hooks](#built-in-hooks)\r\n    * [Write Your Own Hooks](#write-your-own-hooks)\r\n* [Usage](#usage)\r\n* [License](#license)\r\n* [Changelog](CHANGELOG.md)\r\n\r\n## NPM Package Install\r\n\r\n```sh\r\nnpm i vue-logger-plugin@1.x-latest\r\n```\r\n\r\n## Vue Plugin Install\r\n\r\nThe logging implementation can be installed a couple different ways, either by providing options or a constructed VueLogger instance to ```Vue.use```.  \r\n\r\nHere is the simplest usage:\r\n\r\n**`main.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\nVue.use(VueLogger, { <options here> })\r\n// or simply Vue.use(VueLogger) to just use the default options\r\n```\r\n\r\nFor advanced usage (i.e. using conditional options and hooks), it is recommended to export the constructed logger implementation in a separate file and then import into your main file.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\n\r\n// define options\r\nconst options = {\r\n  enabled: true,\r\n  level: 'debug',\r\n  beforeHooks: [ ... ],\r\n  afterHooks: [ ... ]\r\n}\r\n\r\n// export logger with applied options\r\nexport default new VueLogger(options)\r\n```\r\n**`main.js`**\r\n```js\r\nimport logger from './logger'\r\nVue.use(logger)\r\n// note that you may also provide the options argument here as well\r\n// if provided, they would be merged with / override the options already applied\r\n```\r\n\r\nMore information about hooks can be found in the [Hooks](#Hooks) section.\r\n\r\n### Options\r\n\r\n**Name**|**Type**|**Default**|**Description**\r\n:-----|:-----|:-----|:-----\r\nenabled | boolean | true | enable/disable logger\r\nconsoleEnabled | boolean | true | enable/disable console output\r\nlevel | string | 'debug' | the logging level (one of: debug, info, warn, error, log)\r\nbeforeHooks | LoggerHook[] | [] | hooks invoked before a statement is logged, can be used to alter log arguments (use carefully)\r\nafterHooks | LoggerHook[] | [] | hooks invoked after a statement is logged\r\n\r\n**Levels**\r\n\r\nlog <-- error <-- warn <-- info <-- debug\r\n\r\n_(from left to right: least inclusive to most inclusive)_\r\n\r\nSpecify an appropriate level to limit the amount of information logged.  For example, using the 'warn' level will log the 'log', 'error', and 'warn' events but not the 'info' or 'debug' events.\r\n\r\n> Note: Depending on your browser, the debug level may be labeled as \"Verbose\" instead of \"Debug\".  Ensure this level is enabled if looking for debug logs in the browser console.  Chrome uses verbose for these logs, see docs [here](https://developer.chrome.com/docs/devtools/console/log/#browser).\r\n\r\n**enabled vs consoleEnabled**\r\n\r\nSetting `enabled` to false will disable all logger functionality (console output + hook invocations).\r\n\r\nSetting `consoleEnabled` to false will disable just the console output but will still invoke the hooks.\r\n\r\nSo, for example, if you want to prevent writing logs to the browser console but still invoke a hook (i.e. to send logs to a server) then you would set `enabled: true` and `consoleEnabled: false`.\r\n\r\n### Hooks\r\n\r\nHooks allow for advanced customization of the logger implementation, providing operations to be run before and after logging is performed.  These are defined on options as ```beforeHooks``` and ```afterHooks```.\r\n\r\n##### beforeHooks\r\nInvoked before a statement is logged, can alter the log arguments which can impact the log output.\r\n\r\n##### afterHooks\r\nInvoked after a statement is logged, cannot impact the log output.\r\n\r\n#### Built-in Hooks\r\nThe following hooks are available in this package and can be used by simply importing and adding them to the beforeHooks and/or afterHooks arrays of your options.\r\n\r\n**`StringifyObjectsHook`**\r\nApplies JSON.stringify on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyObjectsHook\r\n  ]\r\n}\r\n```\r\n**`StringifyAndParseObjectsHook`**\r\nApplies JSON.stringify and JSON.parse on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyAndParseObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [\r\n    StringifyAndParseObjectsHook\r\n  ]\r\n}\r\n```\r\n\r\nThe above are best used as 'before hooks' as they may purposefully alter the log output.  This way you are sure you are seeing the value of an object at the moment you log it. Otherwise, many browsers provide a live view that constantly updates as values change.\r\n\r\n#### Write Your Own Hooks\r\n\r\nYou can easily write your own hooks to apply custom logic.  A hook must implement a ```run``` function to handle a log event (an object containing the log level and the array of arguments which were passed to the logging method), and may optionally implement an ```install``` function which is invoked during plugin installation (or at the time of logger options application - see [Usage](#usage) section).\r\n\r\nFor reference, here are the interfaces:\r\n```ts\r\nexport interface LoggerHook {\r\n  run (event: LogEvent): void\r\n  install? (options: LoggerOptions): void\r\n  props?: { [key: string]: any }\r\n}\r\nexport interface LogEvent {\r\n  level: string\r\n  argumentArray: any[]\r\n}\r\n```\r\n\r\n##### Sample Custom Hook - Leveraging Axios to Send Logs to Server\r\nThis is a basic example demonstrating how you could have the logger send log data to a server using an Axios client.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook = {\r\n  run (event) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst options = {\r\n  // ... (other options)\r\n  afterHooks: [\r\n    ServerLogHook\r\n  ]\r\n}\r\n\r\nexport default new VueLogger(options)\r\n```\r\n**`logger/index.ts`** (TypeScript example, same functionality as above)\r\n```ts\r\nimport VueLogger, { LoggerOptions, LoggerHook, LogEvent } from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook: LoggerHook = {\r\n  run (event: LogEvent) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst options: LoggerOptions = {\r\n  // ... (other options)\r\n  afterHooks: [\r\n    ServerLogHook\r\n  ]\r\n}\r\n\r\nexport default new VueLogger(options)\r\n```\r\n\r\n## Usage\r\n\r\nOnce installed, the logger is available within the Vue instance via both ```$log``` and ```$logger``` (both access the same logger instance and provide the same functionality).\r\n\r\n```js\r\nnew Vue({\r\n  created: function() {\r\n    const testObject = {\r\n      name: 'test',\r\n      value: 'this is a test object'\r\n    }\r\n    // using $log\r\n    this.$log.debug('Test Message', testObject)\r\n    this.$log.info('Test Message', testObject)\r\n    this.$log.warn('Test Message', testObject)\r\n    this.$log.error('Test Message', testObject)\r\n    this.$log.log('Test Message', testObject)\r\n    // using $logger\r\n    this.$logger.debug('Test Message', testObject)\r\n    this.$logger.info('Test Message', testObject)\r\n    this.$logger.warn('Test Message', testObject)\r\n    this.$logger.error('Test Message', testObject)\r\n    this.$logger.log('Test Message', testObject)\r\n  }\r\n})\r\n```\r\n\r\nAs described in the Vue Plugin Install section above, options can be provided to the VueLogger constructor and/or to the Vue.use method for customizing the logging implementation.  As well, options can be applied at any time to the logger on the Vue instance via the ```apply``` method.  This allows for on-demand enabling/disabling of the logger and adjusting log levels as needed from within your components.\r\n\r\n```js\r\nthis.$log.apply({ level: 'info' }) // applies log level\r\n```\r\n\r\n```js\r\nthis.$log.apply({ enabled: false }) // disables logging\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n[npm-image]: https://img.shields.io/npm/v/vue-logger-plugin/1.x-latest.svg\r\n[npm-url]: https://npmjs.org/package/vue-logger-plugin\r\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\r\n[license-url]: LICENSE\r\n[codecov-image]: https://codecov.io/gh/dev-tavern/vue-logger-plugin/branch/develop-v1/graph/badge.svg?token=WZDGBNBIW5\r\n[codecov-url]: https://codecov.io/gh/dev-tavern/vue-logger-plugin\r\n[circleci-image]: https://circleci.com/gh/dev-tavern/vue-logger-plugin/tree/develop-v1.svg?style=svg\r\n[circleci-url]: https://circleci.com/gh/dev-tavern/vue-logger-plugin?branch=develop-v1\r\n[minified-image]: https://badgen.net/bundlephobia/min/vue-logger-plugin@1.x-latest\r\n[minzipped-image]: https://badgen.net/bundlephobia/minzip/vue-logger-plugin@1.x-latest","readmeFilename":"README.md","gitHead":"febcb907032b0eed7e7c834e002c1e332502d03d","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@1.1.3","_nodeVersion":"16.9.1","_npmVersion":"7.24.0","dist":{"integrity":"sha512-La15uqnUamq66En7IY5W8Q9MDZGgA6HDcCrJT3xMQuZL6ZVnqYnInce2GOMn3ZHonD27g/fAjI5Hj3juRZvFtg==","shasum":"318692a8dc5edc3d8e553b6b913353d057b784c4","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-1.1.3.tgz","fileCount":15,"unpackedSize":27341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/zk2CRA9TVsSAnZWagAAb/wP/jzqiAVf+6nG35JxyjSn\nYGwqcgm8JQJeY9vCpuBYHyythQrHDaf1WcxBfY0UvZW13Ftm1c6sLM0CQJtV\nTlGQ/Tf6ML95mgRlXGPAWsMIoaQgy1zS9nldH0SWH827kJaeo9wg0p21qvnD\nP6KEDVFZD1X9Gvv/L5sFXYo45rtzKgbDN7rIwY/7XgxR1ffwWP6iRREs/7bn\nM3nc9hqGdVGdVoxOfFOyfx00g4y99AfYwJtBjMnwPmi0JTwEJV+Lo42ZnTA0\nB50wT3eianysjCs3A4BMemD09NAxMAahxpE0Ad+f5tEyN0tIvSTLGaZOmOdt\nCP6+gUEyDTMFDIFnVOgHREzjklbxaYVbv9ixyw7jr2SueRW10lLyTtAoPU5A\nVbnPllspGc/mWmeDTf3yrPoWdxX+6TdInKLC0dSfVCJEqSE9Hz40ueLZOsUe\nYMGa0DaKJOj6qO1+7njq84mtHOQf57BjAsYKPu/afIp2bjSV1ABfan3IvFlz\n8tngiLy7uO+VgDeA7HVaJrxdXqTLJO1LcJbao22QEFYn6B3D70sM6uSDrfZQ\nkLV0tIFDuOeUhtXTzYSyAFjeG2OLd6sOFYKRA2S/O3BpZL816Zcf5T5Kc17t\nSi+FJnhjVCu/L97TSzVR5p8uIxIqDIvWpkeHJLy76jr9rQ2rfwtz5p/vNUfQ\n252B\r\n=6IpB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDp/OQv9pnwv1ciKtv1Mc75n8yPB73vTJaFKiCDPj0v8wIgRgYG43kIx9SypzenF7bVwnRNS0kGI97g6M2bPYhAEf8="}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_1.1.3_1644116278602_0.6213411802402808"},"_hasShrinkwrap":false},"1.2.0":{"name":"vue-logger-plugin","version":"1.2.0","description":"Flexible logging functionality for Vue.js","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"1.x-next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"eslint .","lint:fix":"eslint . --fix","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint:fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"devDependencies":{"@types/jest":"^26.0.24","@types/node":"^14.18.10","@typescript-eslint/eslint-plugin":"^5.10.2","@typescript-eslint/parser":"^5.10.2","eslint":"^8.8.0","jest":"^26.6.3","ts-jest":"^26.5.6","tslib":"^2.3.1","typescript":"^4.5.5","vue":"^2.6.11"},"keywords":["vue","logger","logging"],"readme":"# vue-logger-plugin\r\n\r\n[![NPM Version][npm-image]][npm-url]\r\n[![License][license-image]][license-url]\r\n[![codecov][codecov-image]][codecov-url]\r\n[![circleci][circleci-image]][circleci-url]\r\n![minified][minified-image]\r\n![minzipped][minzipped-image]\r\n\r\n> Flexible logging functionality for Vue.js with support for custom hook operations.\r\n\r\nContents\r\n=================\r\n* [NPM Package Install](#npm-package-install)\r\n* [Vue Plugin Install](#vue-plugin-install)\r\n* [Options](#options)\r\n* [Hooks](#hooks)\r\n    * [Built-in Hooks](#built-in-hooks)\r\n    * [Write Your Own Hooks](#write-your-own-hooks)\r\n* [Usage](#usage)\r\n* [License](#license)\r\n* [Changelog](CHANGELOG.md)\r\n\r\n## NPM Package Install\r\n\r\n```sh\r\nnpm i vue-logger-plugin@1.x-latest\r\n```\r\n\r\n## Vue Plugin Install\r\n\r\nThe logging implementation can be installed a couple different ways, either by providing options or a constructed VueLogger instance to ```Vue.use```.  \r\n\r\nHere is the simplest usage:\r\n\r\n**`main.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\nVue.use(VueLogger, { <options here> })\r\n// or simply Vue.use(VueLogger) to just use the default options\r\n```\r\n\r\nFor advanced usage (i.e. using conditional options and hooks), it is recommended to export the constructed logger implementation in a separate file and then import into your main file.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\n\r\n// define options\r\nconst options = {\r\n  enabled: true,\r\n  level: 'debug',\r\n  beforeHooks: [ ... ],\r\n  afterHooks: [ ... ]\r\n}\r\n\r\n// export logger with applied options\r\nexport default new VueLogger(options)\r\n```\r\n**`main.js`**\r\n```js\r\nimport logger from './logger'\r\nVue.use(logger)\r\n// note that you may also provide the options argument here as well\r\n// if provided, they would be merged with / override the options already applied\r\n```\r\n\r\nMore information about hooks can be found in the [Hooks](#Hooks) section.\r\n\r\n## Options\r\n\r\n**Name**|**Type**|**Default**|**Description**\r\n:-----|:-----|:-----|:-----\r\nenabled | boolean | true | enable/disable logger\r\nconsoleEnabled | boolean | true | enable/disable console output\r\nlevel | string | 'debug' | the logging level (one of: debug, info, warn, error, log)\r\ncallerInfo | boolean | false | whether information about the caller function should be included\r\nprefixFormat | string | *(see [below](#prefixFormat))* | provide a custom formatted string for the log message prefix (preceeds the log arguments)\r\nbeforeHooks | LoggerHook[] | [] | hooks invoked before a statement is logged, can be used to alter log arguments (use carefully)\r\nafterHooks | LoggerHook[] | [] | hooks invoked after a statement is logged\r\n\r\n### **Levels**\r\n\r\nlog <-- error <-- warn <-- info <-- debug\r\n\r\n_(from left to right: least inclusive to most inclusive)_\r\n\r\nSpecify an appropriate level to limit the amount of information logged.  For example, using the 'warn' level will log the 'log', 'error', and 'warn' events but not the 'info' or 'debug' events.\r\n\r\n> Note: Depending on your browser, the debug level may be labeled as \"Verbose\" instead of \"Debug\".  Ensure this level is enabled if looking for debug logs in the browser console.  Chrome uses verbose for these logs, see docs [here](https://developer.chrome.com/docs/devtools/console/log/#browser).\r\n\r\n### **enabled vs consoleEnabled**\r\n\r\nSetting `enabled` to false will disable all logger functionality (console output + hook invocations).\r\n\r\nSetting `consoleEnabled` to false will disable just the console output but will still invoke the hooks.\r\n\r\nSo, for example, if you want to prevent writing logs to the browser console but still invoke a hook (i.e. to send logs to a server) then you would set `enabled: true` and `consoleEnabled: false`.\r\n\r\n### **callerInfo**\r\n\r\nSetting `callerInfo` to true will result in caller function information (fileName, functionName, lineNumber) being determined and included in the log, as well as being included in events provided to hooks, for each log function invocation.\r\n\r\n### **prefixFormat**\r\n\r\nUse the `prefixFormat` option to customize the message prefix (portion of log statement that appears before the arguments provided to the log function).\r\nThis can as well be used to inject additional information into the message prefix, such as timestamps or user identifiers for example.\r\n\r\nThe value of this option must be a function which accepts a partial LogEvent object and returns a string.  The provided LogEvent object contains only log `level` and `caller` information.\r\n\r\nThe default for this option is:\r\n```typescript\r\nprefixFormat: ({ level, caller }) => {\r\n  return caller\r\n    ? `${level} | ${caller.fileName}::${caller.functionName} | `\r\n    : `${level} | `\r\n}\r\n```\r\n\r\n## Hooks\r\n\r\nHooks allow for advanced customization of the logger implementation, providing operations to be run before and after logging is performed.  These are defined on options as ```beforeHooks``` and ```afterHooks```.\r\n\r\n### beforeHooks\r\nInvoked before a statement is logged, can alter the log arguments which can impact the log output.\r\n\r\n### afterHooks\r\nInvoked after a statement is logged, cannot impact the log output.\r\n\r\n### Built-in Hooks\r\nThe following hooks are available in this package and can be used by simply importing and adding them to the beforeHooks and/or afterHooks arrays of your options.\r\n\r\n**`StringifyObjectsHook`**\r\nApplies JSON.stringify on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [ StringifyObjectsHook ]\r\n}\r\n```\r\n**`StringifyAndParseObjectsHook`**\r\nApplies JSON.stringify and JSON.parse on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyAndParseObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [ StringifyAndParseObjectsHook ]\r\n}\r\n```\r\n\r\nThe above are best used as 'before hooks' as they may purposefully alter the log output.  This way you are sure you are seeing the value of an object at the moment you log it. Otherwise, many browsers provide a live view that constantly updates as values change.\r\n\r\n### Write Your Own Hooks\r\n\r\nYou can easily write your own hooks to apply custom logic.  A hook must implement a ```run``` function to handle a log event (an object containing the log level and the array of arguments which were passed to the logging method), and may optionally implement an ```install``` function which is invoked during plugin installation (or at the time of logger options application - see [Usage](#usage) section).\r\n\r\nFor reference, here are the interfaces:\r\n```ts\r\nexport interface LoggerHook {\r\n  run (event: LogEvent): void\r\n  install? (options: LoggerOptions): void\r\n  props?: { [key: string]: any }\r\n}\r\nexport interface LogEvent {\r\n  level: LogLevel // 'debug' | 'info' | 'warn' | 'error' | 'log'\r\n  argumentArray: any[]\r\n  caller?: CallerInfo\r\n}\r\nexport interface CallerInfo {\r\n  fileName?: string\r\n  functionName?: string\r\n  lineNumber?: string\r\n}\r\n```\r\n\r\n#### Sample Custom Hook - Leveraging Axios to Send Logs to Server\r\nThis is a basic example demonstrating how you could have the logger send log data to a server using an Axios client.\r\n\r\n**`logger/index.ts`**\r\n```ts\r\nimport VueLogger, { LoggerOptions, LoggerHook, LogEvent } from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook: LoggerHook = {\r\n  run(event: LogEvent) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst options: LoggerOptions = {\r\n  // ... (other options)\r\n  afterHooks: [ ServerLogHook ]\r\n}\r\n\r\nexport default new VueLogger(options)\r\n```\r\n\r\n## Usage\r\n\r\nOnce installed, the logger is available within the Vue instance via both ```$log``` and ```$logger``` (both access the same logger instance and provide the same functionality).\r\n\r\n```js\r\nnew Vue({\r\n  created: function() {\r\n    const testObject = {\r\n      name: 'test',\r\n      value: 'this is a test object'\r\n    }\r\n    // using $log\r\n    this.$log.debug('Test Message', testObject)\r\n    this.$log.info('Test Message', testObject)\r\n    this.$log.warn('Test Message', testObject)\r\n    this.$log.error('Test Message', testObject)\r\n    this.$log.log('Test Message', testObject)\r\n    // using $logger\r\n    this.$logger.debug('Test Message', testObject)\r\n    this.$logger.info('Test Message', testObject)\r\n    this.$logger.warn('Test Message', testObject)\r\n    this.$logger.error('Test Message', testObject)\r\n    this.$logger.log('Test Message', testObject)\r\n  }\r\n})\r\n```\r\n\r\nAs described in the Vue Plugin Install section above, options can be provided to the VueLogger constructor and/or to the Vue.use method for customizing the logging implementation.  As well, options can be applied at any time to the logger on the Vue instance via the ```apply``` method.  This allows for on-demand enabling/disabling of the logger and adjusting log levels as needed from within your components.\r\n\r\n```js\r\nthis.$log.apply({ level: 'info' }) // applies log level\r\n```\r\n\r\n```js\r\nthis.$log.apply({ enabled: false }) // disables logging\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n[npm-image]: https://img.shields.io/npm/v/vue-logger-plugin/1.x-latest.svg\r\n[npm-url]: https://npmjs.org/package/vue-logger-plugin\r\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\r\n[license-url]: LICENSE\r\n[codecov-image]: https://codecov.io/gh/dev-tavern/vue-logger-plugin/branch/develop-v1/graph/badge.svg?token=WZDGBNBIW5\r\n[codecov-url]: https://codecov.io/gh/dev-tavern/vue-logger-plugin\r\n[circleci-image]: https://circleci.com/gh/dev-tavern/vue-logger-plugin/tree/develop-v1.svg?style=svg\r\n[circleci-url]: https://circleci.com/gh/dev-tavern/vue-logger-plugin?branch=develop-v1\r\n[minified-image]: https://badgen.net/bundlephobia/min/vue-logger-plugin@1.x-latest\r\n[minzipped-image]: https://badgen.net/bundlephobia/minzip/vue-logger-plugin@1.x-latest","readmeFilename":"README.md","gitHead":"f12b8ca817ea5d7f36de86bb8acad537aaeee002","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@1.2.0","_nodeVersion":"16.9.1","_npmVersion":"7.24.0","dist":{"integrity":"sha512-2ehE1E8Egzj19XjsFVrSJAM5MnxaKf9+pRngGz3TbhUNeDf5Xx/Gq/XtSBpW96Ivi+nQjI0dRhihhSahdlPkfQ==","shasum":"680c5352962f5f131039ee4479df3c545636327b","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-1.2.0.tgz","fileCount":15,"unpackedSize":32739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/1qDCRA9TVsSAnZWagAAEiUP/1NKdXG1zDh7BxRinIee\nuebsAOaAMIHXhELcrtquWPItpdN7zqLzjeXqxGNd6t2niCuVmyp+1qQT9Kla\nf0PCFVhmswq66sinifhPt7LBOuqqNhMvkqzVdfpYcaJLpnyRpk5qF2fTCKSR\nRZqprqLNVqmyJrKQSUcc3AkGpJ9/GQO9YLhyLIPluYGKZFem4qhlBdNlJ8V0\nkTQGqEZ76isWRQP3oIvvA2+Z0GMliSonB78whrr0shUxpwztoBlmLod+DUXF\nk8b1rMnReZa674J2/J0XjliJJKP+0EmLrh1GkuzGDyhKk2lY4l0ipKOR15Eu\nf3iypTim1xfo/ZrFDebC5dpAmPlRj+mOR8920VU6790bPN66IngRKp5W9JJr\nprzKS0x90E4438VoGvDrJOFvZDC8t3XrOM6JqqpPz3fxDrdEOWHQChGMuoUg\nTTW+Rw+m3ZQvXK1qkVLegfPkqPl+OP4K3N7/Y0idjPaCoLabRLSmo3qjLOaj\nXtWU2tq5JDQ7Y1w4QC6VFaCdX2kamAwzxOS6ejKmlOEkxbCuWVojKFPZrVw1\nk5hwR8HSwS4VOpdRUappqb5z+7g0Hi9xvdyVqIvnJHfcZ0JuuifWQvbZNjBH\nf381SZDvknC+oo3hXF8cXm2DO9wiiP6s6el2GEplQm6jCOKGplYzbzxmTqSb\nKGuq\r\n=Vgxk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDq9Oc+FOEHXaznbsrwgiP6Lxs55YZ4FGSvnsVe40PJpAiEA69/Hi+LS7pys6gi6dXHjyRyVdMguY3YTGKoOb65Qiys="}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_1.2.0_1644124803002_0.21229093440191327"},"_hasShrinkwrap":false},"1.2.1":{"name":"vue-logger-plugin","version":"1.2.1","description":"Flexible logging functionality for Vue.js","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"1.x-next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"eslint .","lint:fix":"eslint . --fix","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint:fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"devDependencies":{"@types/jest":"^26.0.24","@types/node":"^14.18.10","@typescript-eslint/eslint-plugin":"^5.10.2","@typescript-eslint/parser":"^5.10.2","eslint":"^8.8.0","jest":"^26.6.3","ts-jest":"^26.5.6","tslib":"^2.3.1","typescript":"^4.5.5","vue":"^2.6.11"},"keywords":["vue","logger","logging"],"readme":"# vue-logger-plugin\r\n\r\n[![NPM Version][npm-image]][npm-url]\r\n[![License][license-image]][license-url]\r\n[![codecov][codecov-image]][codecov-url]\r\n[![circleci][circleci-image]][circleci-url]\r\n![minified][minified-image]\r\n![minzipped][minzipped-image]\r\n\r\n> Flexible logging functionality for Vue.js with support for custom hook operations.\r\n\r\nContents\r\n=================\r\n* [NPM Package Install](#npm-package-install)\r\n* [Vue Plugin Install](#vue-plugin-install)\r\n* [Options](#options)\r\n* [Hooks](#hooks)\r\n    * [Built-in Hooks](#built-in-hooks)\r\n    * [Write Your Own Hooks](#write-your-own-hooks)\r\n* [Usage](#usage)\r\n* [License](#license)\r\n* [Changelog](CHANGELOG.md)\r\n\r\n## NPM Package Install\r\n\r\n```sh\r\nnpm i vue-logger-plugin@1.x-latest\r\n```\r\n\r\n## Vue Plugin Install\r\n\r\nThe logging implementation can be installed a couple different ways, either by providing options or a constructed VueLogger instance to ```Vue.use```.  \r\n\r\nHere is the simplest usage:\r\n\r\n**`main.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\nVue.use(VueLogger, { <options here> })\r\n// or simply Vue.use(VueLogger) to just use the default options\r\n```\r\n\r\nFor advanced usage (i.e. using conditional options and hooks), it is recommended to export the constructed logger implementation in a separate file and then import into your main file.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\n\r\n// define options\r\nconst options = {\r\n  enabled: true,\r\n  level: 'debug',\r\n  beforeHooks: [ ... ],\r\n  afterHooks: [ ... ]\r\n}\r\n\r\n// export logger with applied options\r\nexport default new VueLogger(options)\r\n```\r\n**`main.js`**\r\n```js\r\nimport logger from './logger'\r\nVue.use(logger)\r\n// note that you may also provide the options argument here as well\r\n// if provided, they would be merged with / override the options already applied\r\n```\r\n\r\nMore information about hooks can be found in the [Hooks](#Hooks) section.\r\n\r\n## Options\r\n\r\n**Name**|**Type**|**Default**|**Description**\r\n:-----|:-----|:-----|:-----\r\nenabled | boolean | true | enable/disable logger\r\nconsoleEnabled | boolean | true | enable/disable console output\r\nlevel | string | 'debug' | the logging level (one of: debug, info, warn, error, log)\r\ncallerInfo | boolean | false | whether information about the caller function should be included\r\nprefixFormat | string | *(see [below](#prefixFormat))* | provide a custom formatted string for the log message prefix (preceeds the log arguments)\r\nbeforeHooks | LoggerHook[] | [] | hooks invoked before a statement is logged, can be used to alter log arguments (use carefully)\r\nafterHooks | LoggerHook[] | [] | hooks invoked after a statement is logged\r\n\r\n### **Levels**\r\n\r\nlog <-- error <-- warn <-- info <-- debug\r\n\r\n_(from left to right: least inclusive to most inclusive)_\r\n\r\nSpecify an appropriate level to limit the amount of information logged.  For example, using the 'warn' level will log the 'log', 'error', and 'warn' events but not the 'info' or 'debug' events.\r\n\r\n> Note: Depending on your browser, the debug level may be labeled as \"Verbose\" instead of \"Debug\".  Ensure this level is enabled if looking for debug logs in the browser console.  Chrome uses verbose for these logs, see docs [here](https://developer.chrome.com/docs/devtools/console/log/#browser).\r\n\r\n### **enabled vs consoleEnabled**\r\n\r\nSetting `enabled` to false will disable all logger functionality (console output + hook invocations).\r\n\r\nSetting `consoleEnabled` to false will disable just the console output but will still invoke the hooks.\r\n\r\nSo, for example, if you want to prevent writing logs to the browser console but still invoke a hook (i.e. to send logs to a server) then you would set `enabled: true` and `consoleEnabled: false`.\r\n\r\n### **callerInfo**\r\n\r\nSetting `callerInfo` to true will result in caller function information (fileName, functionName, lineNumber) being determined and included in the log, as well as being included in events provided to hooks, for each log function invocation.\r\n\r\n### **prefixFormat**\r\n\r\nUse the `prefixFormat` option to customize the message prefix (portion of log statement that appears before the arguments provided to the log function).\r\nThis can as well be used to inject additional information into the message prefix, such as timestamps or user identifiers for example.\r\n\r\nThe value of this option must be a function which accepts a partial LogEvent object and returns a string.  The provided LogEvent object contains only log `level` and `caller` information.\r\n\r\nThe default for this option is:\r\n```typescript\r\nprefixFormat: ({ level, caller }) => (\r\n    caller\r\n      ? `[${level.toUpperCase()}] [${caller?.fileName}:${caller?.functionName}:${caller?.lineNumber}]`\r\n      : `[${level.toUpperCase()}]`\r\n  )\r\n```\r\n\r\n## Hooks\r\n\r\nHooks allow for advanced customization of the logger implementation, providing operations to be run before and after logging is performed.  These are defined on options as ```beforeHooks``` and ```afterHooks```.\r\n\r\n### beforeHooks\r\nInvoked before a statement is logged, can alter the log arguments which can impact the log output.\r\n\r\n### afterHooks\r\nInvoked after a statement is logged, cannot impact the log output.\r\n\r\n### Built-in Hooks\r\nThe following hooks are available in this package and can be used by simply importing and adding them to the beforeHooks and/or afterHooks arrays of your options.\r\n\r\n**`StringifyObjectsHook`**\r\nApplies JSON.stringify on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [ StringifyObjectsHook ]\r\n}\r\n```\r\n**`StringifyAndParseObjectsHook`**\r\nApplies JSON.stringify and JSON.parse on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyAndParseObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [ StringifyAndParseObjectsHook ]\r\n}\r\n```\r\n\r\nThe above are best used as 'before hooks' as they may purposefully alter the log output.  This way you are sure you are seeing the value of an object at the moment you log it. Otherwise, many browsers provide a live view that constantly updates as values change.\r\n\r\n### Write Your Own Hooks\r\n\r\nYou can easily write your own hooks to apply custom logic.  A hook must implement a ```run``` function to handle a log event (an object containing the log level and the array of arguments which were passed to the logging method), and may optionally implement an ```install``` function which is invoked during plugin installation (or at the time of logger options application - see [Usage](#usage) section).\r\n\r\nFor reference, here are the interfaces:\r\n```ts\r\nexport interface LoggerHook {\r\n  run (event: LogEvent): void\r\n  install? (options: LoggerOptions): void\r\n  props?: { [key: string]: any }\r\n}\r\nexport interface LogEvent {\r\n  level: LogLevel // 'debug' | 'info' | 'warn' | 'error' | 'log'\r\n  argumentArray: any[]\r\n  caller?: CallerInfo\r\n}\r\nexport interface CallerInfo {\r\n  fileName?: string\r\n  functionName?: string\r\n  lineNumber?: string\r\n}\r\n```\r\n\r\n#### Sample Custom Hook - Leveraging Axios to Send Logs to Server\r\nThis is a basic example demonstrating how you could have the logger send log data to a server using an Axios client.\r\n\r\n**`logger/index.ts`**\r\n```ts\r\nimport VueLogger, { LoggerOptions, LoggerHook, LogEvent } from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook: LoggerHook = {\r\n  run(event: LogEvent) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst options: LoggerOptions = {\r\n  // ... (other options)\r\n  afterHooks: [ ServerLogHook ]\r\n}\r\n\r\nexport default new VueLogger(options)\r\n```\r\n\r\n## Usage\r\n\r\nOnce installed, the logger is available within the Vue instance via both ```$log``` and ```$logger``` (both access the same logger instance and provide the same functionality).\r\n\r\n```js\r\nnew Vue({\r\n  created: function() {\r\n    const testObject = {\r\n      name: 'test',\r\n      value: 'this is a test object'\r\n    }\r\n    // using $log\r\n    this.$log.debug('Test Message', testObject)\r\n    this.$log.info('Test Message', testObject)\r\n    this.$log.warn('Test Message', testObject)\r\n    this.$log.error('Test Message', testObject)\r\n    this.$log.log('Test Message', testObject)\r\n    // using $logger\r\n    this.$logger.debug('Test Message', testObject)\r\n    this.$logger.info('Test Message', testObject)\r\n    this.$logger.warn('Test Message', testObject)\r\n    this.$logger.error('Test Message', testObject)\r\n    this.$logger.log('Test Message', testObject)\r\n  }\r\n})\r\n```\r\n\r\nAs described in the Vue Plugin Install section above, options can be provided to the VueLogger constructor and/or to the Vue.use method for customizing the logging implementation.  As well, options can be applied at any time to the logger on the Vue instance via the ```apply``` method.  This allows for on-demand enabling/disabling of the logger and adjusting log levels as needed from within your components.\r\n\r\n```js\r\nthis.$log.apply({ level: 'info' }) // applies log level\r\n```\r\n\r\n```js\r\nthis.$log.apply({ enabled: false }) // disables logging\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n[npm-image]: https://img.shields.io/npm/v/vue-logger-plugin/1.x-latest.svg\r\n[npm-url]: https://npmjs.org/package/vue-logger-plugin\r\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\r\n[license-url]: LICENSE\r\n[codecov-image]: https://codecov.io/gh/dev-tavern/vue-logger-plugin/branch/develop-v1/graph/badge.svg?token=WZDGBNBIW5\r\n[codecov-url]: https://codecov.io/gh/dev-tavern/vue-logger-plugin\r\n[circleci-image]: https://circleci.com/gh/dev-tavern/vue-logger-plugin/tree/develop-v1.svg?style=svg\r\n[circleci-url]: https://circleci.com/gh/dev-tavern/vue-logger-plugin?branch=develop-v1\r\n[minified-image]: https://badgen.net/bundlephobia/min/vue-logger-plugin@1.x-latest\r\n[minzipped-image]: https://badgen.net/bundlephobia/minzip/vue-logger-plugin@1.x-latest","readmeFilename":"README.md","gitHead":"bdcaff9ce9b8f4963a5e7faeec9460d416c5f417","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@1.2.1","_nodeVersion":"16.9.1","_npmVersion":"7.24.0","dist":{"integrity":"sha512-M6N9hfs48ghRqstkGO0indfL/VcdsaXZF+RGdBM/nBCdCRBUCbg8sWihAdxdr96JO5+ZQhwYlZkUQ+ASyf+3pA==","shasum":"be1ebd9c59d6a2873b1588798272764dfa0d0153","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-1.2.1.tgz","fileCount":15,"unpackedSize":34332,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBJRFCRA9TVsSAnZWagAAHlIP/0RyktR5thHwYbRz691N\ntX+mDrJUg54uaaiimFoPumkzYb7+DtC9WoVf7DNVwguxefCxraSmqOZRPGfr\nYGWyFlay0ejtkhLMxaaIz4Mdz8HuWe0yj6xBFhFQSiTAdyA8vkh2cV4XZ99F\nplH80VClL06meRM8ij8j/tByVWkHwHVm+aP6rmkOpxRpi8G2OxFDUppuUYSv\n2G58aUNfix3h8uylKfd8EexGdPw2gJgyGf8D39vom63DOobFVJsuEYqnHk8v\n2ozKobjYTfeAKZjEMzKFy0+aPeqRyLFlyZme0KeymAiAyvZLZMdAgBJEz/nW\n+RmNzdRBJFG06JXPS3veZo1g7ALSE5NmvmiHo9WG/3owMXi1q6/AtARdvgLZ\n5/RsKdpehz1WYSoqrSfkivF5GsLH01qUAnjkGtuGvVwFfkffFh/n5+4fdLGs\ntBv3amIxFw3/w1Ir1gyvjx8xvLuvEpO1rME98MeAgnRb6bIX+bD7Y9Vxtbcx\n+HfX82K4bC3Jwo9tTiOGwc3mI9lZd2CStcUj2BMWg9NfQ7wJI5u3h/RpCqF/\nVjvA1dMSC8FLWY2LfulNsVh0gRLbewokr8SpxTXbqaHiztcH4v+HED2dQ3/2\nhl1Zokf6X9VdEbqvjI0iHMQyvXlxwQ8auH0UhJRKaKpVPgIe2xWbZLJ80/Nd\nGy22\r\n=ZVXC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGcXMntrrteDsvzgkyUIzBkRBjK9Dx4f4NJ+qG35uh+cAiAkpPCsN6B+/9VD95T+rImwqbSQaB9Dsi/OXA4M9rok+Q=="}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_1.2.1_1644467269431_0.4003943405550541"},"_hasShrinkwrap":false},"2.2.1":{"name":"vue-logger-plugin","version":"2.2.1","description":"Flexible logging functionality for Vue.js 2 & 3","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"eslint .","lint:fix":"eslint . --fix","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint:fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"devDependencies":{"@types/jest":"^26.0.14","@types/node":"^14.11.1","@typescript-eslint/eslint-plugin":"^5.10.2","@typescript-eslint/parser":"^5.10.2","eslint":"^8.8.0","jest":"^26.4.2","ts-jest":"^26.4.0","tslib":"^2.0.1","typescript":"^4.0.3","vue":"^3.0.0"},"keywords":["vue","vue 2","vue 3","logger","logging"],"gitHead":"7bdc5df73995738e73c96bbbf5bb27a24b3952ca","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@2.2.1","_nodeVersion":"16.9.1","_npmVersion":"7.24.0","dist":{"integrity":"sha512-KZ1jBBxmssgA7tsi2V6+fM6Al2ZCOzAD5nqLoTBJYdDdKcMBV+CyXloZil3C6AR0a0QJfF3wvwxO1laFRg+/jQ==","shasum":"cfea8f5634a408e419d08d0ef7a8c0935c26ff21","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-2.2.1.tgz","fileCount":13,"unpackedSize":32402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBJSTCRA9TVsSAnZWagAAx0cP/0zzcbuU5j3fx2FkZXD8\nJcMb8m9d24aB+uuFq8paj3l2So8Zlm6semKZi3rv7nIKyaJLbfaavqnP71Pm\nByt+mH8YaPk6lhhkF9weXSDu6zjipHe15YHh6sXEl240mPUkpfYVtMIzH2v5\naXyvJNskjfIp0I5qqDMPdX4hrnfzFw4Oeh92+r3dDazjrd0FR8ZEpvJEjhIB\nm6U2P3hh0Frelp7ChoqDTYs3B7vGcZmCK0ILfeI8Lu+6um8WIAEMQPZDIH2z\nmZX4Y5jRUwYTuRSw6WPziRbNaAiOSOaiojhDdoBG0rCIkJwlOyH+0ZAMv+hr\nxiP7WPqhwmL4paMr4EFJ3ke+gkqDzljuCWyn04ReXAtTeJRNXbX10Sf+LYrA\nbSqku9MejrElnm4z4mbSkZz63R0QbhwGt6Mz7skERDMZkq01sd5xUcBM5Nx0\nc997yJdq8VZEgOT79PnBL1TvbBhNGNKZLYkgcCiUuLkOcYJiJIO/wB9QV8yx\nvznB9Gd22mNN6L53Gl3EfkSTOqzvTC0Zm5QwIraagKxXe6ZSUFtgbV1Laguw\nHyHz79f6T69YHwbU2G2p+zdm32CeNsTPe6YGbu7o7++NsAEIFblBPzmfvtEd\nyynHJMoUVSY09tfkN7htN1I6HzoMRKortxINK30O9EtjX/idpLwtXRgZSrBV\n9Epg\r\n=ra1g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBNh4f53Oas5o08sTPVcP8fJt8viKz0eBp1nUsS3vYjiAiBOWl0MM6sUrjOgQf9oXTqIGqvq0lmr8Sl+dPT2lAd7Xg=="}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_2.2.1_1644467346815_0.0794743200880752"},"_hasShrinkwrap":false},"2.2.2":{"name":"vue-logger-plugin","version":"2.2.2","description":"Flexible logging functionality for Vue.js 2 & 3","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"eslint .","lint:fix":"eslint . --fix","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint:fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"devDependencies":{"@types/jest":"^26.0.14","@types/node":"^14.11.1","@typescript-eslint/eslint-plugin":"^5.10.2","@typescript-eslint/parser":"^5.10.2","eslint":"^8.8.0","jest":"^26.4.2","ts-jest":"^26.4.0","tslib":"^2.0.1","typescript":"^4.0.3","vue":"^3.0.0"},"keywords":["vue","vue 2","vue 3","logger","logging"],"gitHead":"67c7e5f4deb3923d1d91e162528a6b7520cd68fe","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@2.2.2","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"integrity":"sha512-he5TODpSYWtqv1es4BhDUrSZ5YLl13f2W/Ycu8/30q3uMpPF4uEh/iotOP1DTW90tJR//Wc3JC+6gLntrBpEpg==","shasum":"e49b8aef21263e054ffe96e39e9e8f4bcde3e073","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-2.2.2.tgz","fileCount":14,"unpackedSize":35378,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIA8NACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqvmRAAiZZACSxkHhVmWEJe1mSNVk4ciwZ696SIIA/9EcO88MGW9I/9\r\n92A1fPallyTbsT6J/iYV0n5btMsqc++IDgUV2UP7hiCOao3Vpe5i81RR1XnF\r\nXo4CBJ54Pxj+BUe5ajrne4TDTl6+qrLD5eDMDLuo1E8pddyX2vKB6kS7SVnr\r\nWaEA0DVPvioYkmBUYCE5XHnLmxUUTIp3L3l4WgXK98yZW7cUwdzoNWZnfuuZ\r\nV1d3oMjF5JuAF0PEXmkJDnoEv5ScWJjPyl3JjLbro5yP9jLeE9JdilmkkGJq\r\n45XTwUoXJaqjyTiLXKURKh8TizHWHBH2wIYhxsX4NmP/IEQZCBjyNmJN76Dd\r\n7/w5rFl6raKSDQn32ShQtO4PneQ5PgNiiW1tz1VkeYwme0rhuD5NBqhvW/Xs\r\nlGrZXQJY+ZhWqSXhoWVTwlmvmw0Pxmewa/bmwDXnkpi0RWW8htcf+zgs04rt\r\nliWGNIPxjifjtWLP21IMZ43s7XG68kLEtGr9QsXFpUG87O5dhWPnyJxrWael\r\nW70u0T9VM3IkF9ZQXXRKQVA9cDQb6rregFtazCzkCwVy2esmlcW8fTIqhLiv\r\nfNHseX2ii4qub/ePSiRQC54wvTWVU8Md9ZE9/HGPYPhkButS1rVD2Rulvzwj\r\ndw6eTQb2jdGsCJ3DXDGFoR7i5e8PQuSnT30=\r\n=xryZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJrPALtyn9/AoWwojmvn2innJgqD2lDm3E9ZorndUeSAIgSnYT4dSmL/V5YdmSxUX5kKXgxOYH0XCnnVAX2410xvY="}]},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_2.2.2_1646268173616_0.5404528723045803"},"_hasShrinkwrap":false},"2.2.3":{"name":"vue-logger-plugin","version":"2.2.3","description":"Flexible logging functionality for Vue.js 2 & 3","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"eslint .","lint:fix":"eslint . --fix","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint:fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"devDependencies":{"@types/jest":"^26.0.14","@types/node":"^14.11.1","@typescript-eslint/eslint-plugin":"^5.10.2","@typescript-eslint/parser":"^5.10.2","eslint":"^8.8.0","jest":"^26.4.2","ts-jest":"^26.4.0","tslib":"^2.0.1","typescript":"^4.0.3","vue":"^3.0.0"},"keywords":["vue","vue 2","vue 3","logger","logging"],"gitHead":"350421b9aa0acafe4c33dc6445b065afe7435e5c","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@2.2.3","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-PGGwFarWpReyJc8XONuNBb86mpfLqYO6+MWjkFnCDWcagjM2BLY7rskLTgn3eT3skq0qu+2K2roiIAgiXJDXSQ==","shasum":"ed6ba748af8d46622f7ff2f80dbe4e3a30543fc8","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-2.2.3.tgz","fileCount":13,"unpackedSize":32944,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFfg1zlejx/XVHVQszaIqVy0gJM3hEDZ0VG6HtTDnPvwIhANnket0Ojc/27JAAzNiaaZIaHUQcKI9VgHaqQRvk7Blp"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijZ30ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUPRAAoF9HUhlTpM3sUuqo2WboyigXV4mDwlmGJjKYz58+jaZyf/i+\r\nGU9TowoDYNBkHi6haSwpcEoM+dIo/pIcUSY0VMzee0yw/qbTf0NimAC4hcUC\r\nFfwTOM7gbq+Y5WzZ/0l358wIMMrFCW77RgniC9YLKMXHOSLsZJLFE/HuO+Kx\r\nV7KXGYMxaIavTw+RPMhJXelXli2XP4fPAZQuDWVfg3GVsueiciOd6fqfVSZb\r\nNn8NZ4v8P+jdUDGtQnF1x3h1o/vJqecWTtkLTVV6sH5imANC/RnPE+qwuLoo\r\nHahecZl6SYRoCSGFdnpzoEWZzqYIa8gfwHlq3zF9YKC9iCZ7t1qdiOlBBuyP\r\nqUaD73H22Ma82OX5vLLZe7pcTyKtnbMiicWQkqV8/DjSzlmqFrvFgIcaDa+D\r\nei6kY9oBJvsly3UkTN9jwcwWjAc/IArrylCSK/RQkELCI1Nr8/R09y9j5mWa\r\nvaXGcgKRFHpevx+g9NKyXyJhoeoVQp4EtHn8xdfs6C2SByt1fu5uoD0B+rXG\r\nPKKZpwaO/XXal5Oogh/wZ+jiUXHJ8KioysU/6xNOh8+GeLikhbP6oDubc9yx\r\n6TfY1jYk0TZfmK25tBRaaQj6uIWyZw0V3fP6oInvZAEihf5ndN9Murpts79b\r\nvhW7PKNrHPTWWesO7i1oyJGYxPBQ8FS5QqY=\r\n=TAHM\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_2.2.3_1653448180230_0.6558888432864602"},"_hasShrinkwrap":false},"1.2.2":{"name":"vue-logger-plugin","version":"1.2.2","description":"Flexible logging functionality for Vue.js","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"1.x-next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"eslint .","lint:fix":"eslint . --fix","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint:fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"devDependencies":{"@types/jest":"^26.0.24","@types/node":"^14.18.10","@typescript-eslint/eslint-plugin":"^5.10.2","@typescript-eslint/parser":"^5.10.2","eslint":"^8.8.0","jest":"^26.6.3","ts-jest":"^26.5.6","tslib":"^2.3.1","typescript":"^4.5.5","vue":"^2.6.11"},"keywords":["vue","logger","logging"],"readme":"# vue-logger-plugin\r\n\r\n[![NPM Version][npm-image]][npm-url]\r\n[![License][license-image]][license-url]\r\n[![codecov][codecov-image]][codecov-url]\r\n[![circleci][circleci-image]][circleci-url]\r\n![minified][minified-image]\r\n![minzipped][minzipped-image]\r\n\r\n> Flexible logging functionality for Vue.js with support for custom hook operations.\r\n\r\nContents\r\n=================\r\n* [NPM Package Install](#npm-package-install)\r\n* [Vue Plugin Install](#vue-plugin-install)\r\n* [Options](#options)\r\n* [Hooks](#hooks)\r\n    * [Built-in Hooks](#built-in-hooks)\r\n    * [Write Your Own Hooks](#write-your-own-hooks)\r\n* [Usage](#usage)\r\n* [License](#license)\r\n* [Changelog](CHANGELOG.md)\r\n\r\n## NPM Package Install\r\n\r\n```sh\r\nnpm i vue-logger-plugin@1.x-latest\r\n```\r\n\r\n## Vue Plugin Install\r\n\r\nThe logging implementation can be installed a couple different ways, either by providing options or a constructed VueLogger instance to ```Vue.use```.  \r\n\r\nHere is the simplest usage:\r\n\r\n**`main.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\nVue.use(VueLogger, { <options here> })\r\n// or simply Vue.use(VueLogger) to just use the default options\r\n```\r\n\r\nFor advanced usage (i.e. using conditional options and hooks), it is recommended to export the constructed logger implementation in a separate file and then import into your main file.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\n\r\n// define options\r\nconst options = {\r\n  enabled: true,\r\n  level: 'debug',\r\n  beforeHooks: [ ... ],\r\n  afterHooks: [ ... ]\r\n}\r\n\r\n// export logger with applied options\r\nexport default new VueLogger(options)\r\n```\r\n**`main.js`**\r\n```js\r\nimport logger from './logger'\r\nVue.use(logger)\r\n// note that you may also provide the options argument here as well\r\n// if provided, they would be merged with / override the options already applied\r\n```\r\n\r\nMore information about hooks can be found in the [Hooks](#Hooks) section.\r\n\r\n## Options\r\n\r\n**Name**|**Type**|**Default**|**Description**\r\n:-----|:-----|:-----|:-----\r\nenabled | boolean | true | enable/disable logger\r\nconsoleEnabled | boolean | true | enable/disable console output\r\nlevel | string | 'debug' | the logging level (one of: debug, info, warn, error, log)\r\ncallerInfo | boolean | false | whether information about the caller function should be included\r\nprefixFormat | string | *(see [below](#prefixFormat))* | provide a custom formatted string for the log message prefix (preceeds the log arguments)\r\nbeforeHooks | LoggerHook[] | [] | hooks invoked before a statement is logged, can be used to alter log arguments (use carefully)\r\nafterHooks | LoggerHook[] | [] | hooks invoked after a statement is logged\r\n\r\n### **Levels**\r\n\r\nlog <-- error <-- warn <-- info <-- debug\r\n\r\n_(from left to right: least inclusive to most inclusive)_\r\n\r\nSpecify an appropriate level to limit the amount of information logged.  For example, using the 'warn' level will log the 'log', 'error', and 'warn' events but not the 'info' or 'debug' events.\r\n\r\n> Note: Depending on your browser, the debug level may be labeled as \"Verbose\" instead of \"Debug\".  Ensure this level is enabled if looking for debug logs in the browser console.  Chrome uses verbose for these logs, see docs [here](https://developer.chrome.com/docs/devtools/console/log/#browser).\r\n\r\n### **enabled vs consoleEnabled**\r\n\r\nSetting `enabled` to false will disable all logger functionality (console output + hook invocations).\r\n\r\nSetting `consoleEnabled` to false will disable just the console output but will still invoke the hooks.\r\n\r\nSo, for example, if you want to prevent writing logs to the browser console but still invoke a hook (i.e. to send logs to a server) then you would set `enabled: true` and `consoleEnabled: false`.\r\n\r\n### **callerInfo**\r\n\r\nSetting `callerInfo` to true will result in caller function information (fileName, functionName, lineNumber) being determined and included in the log, as well as being included in events provided to hooks, for each log function invocation.\r\n\r\n### **prefixFormat**\r\n\r\nUse the `prefixFormat` option to customize the message prefix (portion of log statement that appears before the arguments provided to the log function).\r\nThis can as well be used to inject additional information into the message prefix, such as timestamps or user identifiers for example.\r\n\r\nThe value of this option must be a function which accepts a partial LogEvent object and returns a string.  The provided LogEvent object contains only log `level` and `caller` information.\r\n\r\nThe default for this option is:\r\n```typescript\r\nprefixFormat: ({ level, caller }) => (\r\n    caller\r\n      ? `[${level.toUpperCase()}] [${caller?.fileName}:${caller?.functionName}:${caller?.lineNumber}]`\r\n      : `[${level.toUpperCase()}]`\r\n  )\r\n```\r\n\r\n## Hooks\r\n\r\nHooks allow for advanced customization of the logger implementation, providing operations to be run before and after logging is performed.  These are defined on options as ```beforeHooks``` and ```afterHooks```.\r\n\r\n### beforeHooks\r\nInvoked before a statement is logged, can alter the log arguments which can impact the log output.\r\n\r\n### afterHooks\r\nInvoked after a statement is logged, cannot impact the log output.\r\n\r\n### Built-in Hooks\r\nThe following hooks are available in this package and can be used by simply importing and adding them to the beforeHooks and/or afterHooks arrays of your options.\r\n\r\n**`StringifyObjectsHook`**\r\nApplies JSON.stringify on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [ StringifyObjectsHook ]\r\n}\r\n```\r\n**`StringifyAndParseObjectsHook`**\r\nApplies JSON.stringify and JSON.parse on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyAndParseObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [ StringifyAndParseObjectsHook ]\r\n}\r\n```\r\n\r\nThe above are best used as 'before hooks' as they may purposefully alter the log output.  This way you are sure you are seeing the value of an object at the moment you log it. Otherwise, many browsers provide a live view that constantly updates as values change.\r\n\r\n### Write Your Own Hooks\r\n\r\nYou can easily write your own hooks to apply custom logic.  A hook must implement a ```run``` function to handle a log event (an object containing the log level and the array of arguments which were passed to the logging method), and may optionally implement an ```install``` function which is invoked during plugin installation (or at the time of logger options application - see [Usage](#usage) section).\r\n\r\nFor reference, here are the interfaces:\r\n```ts\r\nexport interface LoggerHook {\r\n  run (event: LogEvent): void\r\n  install? (options: LoggerOptions): void\r\n  props?: { [key: string]: any }\r\n}\r\nexport interface LogEvent {\r\n  level: LogLevel // 'debug' | 'info' | 'warn' | 'error' | 'log'\r\n  argumentArray: any[]\r\n  caller?: CallerInfo\r\n}\r\nexport interface CallerInfo {\r\n  fileName?: string\r\n  functionName?: string\r\n  lineNumber?: string\r\n}\r\n```\r\n\r\n#### Sample Custom Hook - Leveraging Axios to Send Logs to Server\r\nThis is a basic example demonstrating how you could have the logger send log data to a server using an Axios client.\r\n\r\n**`logger/index.ts`**\r\n```ts\r\nimport VueLogger, { LoggerOptions, LoggerHook, LogEvent } from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook: LoggerHook = {\r\n  run(event: LogEvent) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst options: LoggerOptions = {\r\n  // ... (other options)\r\n  afterHooks: [ ServerLogHook ]\r\n}\r\n\r\nexport default new VueLogger(options)\r\n```\r\n\r\n## Usage\r\n\r\nOnce installed, the logger is available within the Vue instance via both ```$log``` and ```$logger``` (both access the same logger instance and provide the same functionality).\r\n\r\n```js\r\nnew Vue({\r\n  created: function() {\r\n    const testObject = {\r\n      name: 'test',\r\n      value: 'this is a test object'\r\n    }\r\n    // using $log\r\n    this.$log.debug('Test Message', testObject)\r\n    this.$log.info('Test Message', testObject)\r\n    this.$log.warn('Test Message', testObject)\r\n    this.$log.error('Test Message', testObject)\r\n    this.$log.log('Test Message', testObject)\r\n    // using $logger\r\n    this.$logger.debug('Test Message', testObject)\r\n    this.$logger.info('Test Message', testObject)\r\n    this.$logger.warn('Test Message', testObject)\r\n    this.$logger.error('Test Message', testObject)\r\n    this.$logger.log('Test Message', testObject)\r\n  }\r\n})\r\n```\r\n\r\nAs described in the Vue Plugin Install section above, options can be provided to the VueLogger constructor and/or to the Vue.use method for customizing the logging implementation.  As well, options can be applied at any time to the logger on the Vue instance via the ```apply``` method.  This allows for on-demand enabling/disabling of the logger and adjusting log levels as needed from within your components.\r\n\r\n```js\r\nthis.$log.apply({ level: 'info' }) // applies log level\r\n```\r\n\r\n```js\r\nthis.$log.apply({ enabled: false }) // disables logging\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n[npm-image]: https://img.shields.io/npm/v/vue-logger-plugin/1.x-latest.svg\r\n[npm-url]: https://npmjs.org/package/vue-logger-plugin\r\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\r\n[license-url]: LICENSE\r\n[codecov-image]: https://codecov.io/gh/dev-tavern/vue-logger-plugin/branch/develop-v1/graph/badge.svg?token=WZDGBNBIW5\r\n[codecov-url]: https://codecov.io/gh/dev-tavern/vue-logger-plugin\r\n[circleci-image]: https://circleci.com/gh/dev-tavern/vue-logger-plugin/tree/develop-v1.svg?style=svg\r\n[circleci-url]: https://circleci.com/gh/dev-tavern/vue-logger-plugin?branch=develop-v1\r\n[minified-image]: https://badgen.net/bundlephobia/min/vue-logger-plugin@1.x-latest\r\n[minzipped-image]: https://badgen.net/bundlephobia/minzip/vue-logger-plugin@1.x-latest","readmeFilename":"README.md","gitHead":"22d22235a94ec6405d953ff7b65c888989c7dff6","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@1.2.2","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-hWwG/4AAylE/zjR3MIQ6wxj1D28M7mM7tz1aQJP1PNWgDr8EsX3TvFT+t27MXHK0iOqOL06DwCBS9TF8xYM/yQ==","shasum":"13319de0f84c8a9239eb3c147bb5d5acbfd9db0e","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-1.2.2.tgz","fileCount":15,"unpackedSize":34332,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDM3/lPNB9ArloD0VWaV7yB8kbmmMfz0LbzAGOY6v+eHgIgMZWt2hBj7b9Dez7jmDFak33+qky2va/NBGwSE4MLKO4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijahHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDTRAAk8cRFSAaxxXx3cgU49XBgM6KwSiB1wzTt5Lh7MuZ1rkEplKJ\r\nPKlVoxjZCzGpJjbfvglikig7YZsEYjNYimlNYgRjeai7meYTxEQT8paserzo\r\nhmRTPJs2YmERjYn1Op67tvMKk1EiAi6eTkOrNYegmS1pO8UX5r0mOcYwnSqo\r\njl/3jwo8gGOhEy2egISY43/7+ecRtgwPCzKbE5uaLQyPCQpPYP+IYdyf4hRh\r\n7uj4p66s7SlvACCT0FGHITYabYQl9af5pJD35PBmuBQylCSD9ssiuprttpnq\r\ngisDqDpefLsOy9s3wtYFiRHQe22Orymp9RTEDdp/WXmxwrCduYWRhzIgFP0A\r\nMLzr/6PSc46FSEOatpNAuyfWgrHVtbep98wcYl4KutcDTJibb6EKImUgAsl5\r\nfadkPdSqgSjenPm/0KnqP9mD+U4a8912cZBOOLiF5/L4DkdW85IleTEG7qIS\r\n9M1r2FipwXeVE/i/2prW5R68ojQ1YXxFYUtmN6p2L7d6pi2US1QfWRWFvnLJ\r\nn2ZGNNBRG/3HVgeZauAsAqwYgnLIynwiGBX7oZwjn6PSyiDCjIi4T4koGBnP\r\nolAD1BMCJiboef85Fj7DD9vMae5IQejeLh0rvytJfABtqTR88laEPxO3wlUu\r\nRn+P96otEqPygHT20OHYJpCKoC3/wFBD9RM=\r\n=Csad\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_1.2.2_1653450823284_0.05229150279546402"},"_hasShrinkwrap":false},"1.2.3":{"name":"vue-logger-plugin","version":"1.2.3","description":"Flexible logging functionality for Vue.js","author":{"name":"Josh Gamble"},"license":"MIT","main":"dist/index.js","typings":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","publishConfig":{"tag":"1.x-next"},"scripts":{"build":"tsc && cp -R src/types ./dist/","test":"jest --coverage --config jestconfig.json","lint":"eslint .","lint:fix":"eslint . --fix","prepare":"npm run build","prepublishOnly":"npm run test && npm run lint","preversion":"npm run lint","version":"npm run lint:fix && git add -A src","postversion":"git push && git push --tags","ci:test":"jest --coverage --ci --maxWorkers=2 --config jestconfig.json"},"devDependencies":{"@types/jest":"^26.0.24","@types/node":"^14.18.10","@typescript-eslint/eslint-plugin":"^5.10.2","@typescript-eslint/parser":"^5.10.2","eslint":"^8.8.0","jest":"^26.6.3","ts-jest":"^26.5.6","tslib":"^2.3.1","typescript":"^4.5.5","vue":"^2.6.11"},"keywords":["vue","logger","logging"],"readme":"# vue-logger-plugin\r\n\r\n[![NPM Version][npm-image]][npm-url]\r\n[![License][license-image]][license-url]\r\n[![codecov][codecov-image]][codecov-url]\r\n[![circleci][circleci-image]][circleci-url]\r\n![minified][minified-image]\r\n![minzipped][minzipped-image]\r\n\r\n> Flexible logging functionality for Vue.js with support for custom hook operations.\r\n\r\nContents\r\n=================\r\n* [NPM Package Install](#npm-package-install)\r\n* [Vue Plugin Install](#vue-plugin-install)\r\n* [Options](#options)\r\n* [Hooks](#hooks)\r\n    * [Built-in Hooks](#built-in-hooks)\r\n    * [Write Your Own Hooks](#write-your-own-hooks)\r\n* [Usage](#usage)\r\n* [License](#license)\r\n* [Changelog](CHANGELOG.md)\r\n\r\n## NPM Package Install\r\n\r\n```sh\r\nnpm i vue-logger-plugin@1.x-latest\r\n```\r\n\r\n## Vue Plugin Install\r\n\r\nThe logging implementation can be installed a couple different ways, either by providing options or a constructed VueLogger instance to ```Vue.use```.  \r\n\r\nHere is the simplest usage:\r\n\r\n**`main.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\nVue.use(VueLogger, { <options here> })\r\n// or simply Vue.use(VueLogger) to just use the default options\r\n```\r\n\r\nFor advanced usage (i.e. using conditional options and hooks), it is recommended to export the constructed logger implementation in a separate file and then import into your main file.\r\n\r\n**`logger/index.js`**\r\n```js\r\nimport VueLogger from 'vue-logger-plugin'\r\n\r\n// define options\r\nconst options = {\r\n  enabled: true,\r\n  level: 'debug',\r\n  beforeHooks: [ ... ],\r\n  afterHooks: [ ... ]\r\n}\r\n\r\n// export logger with applied options\r\nexport default new VueLogger(options)\r\n```\r\n**`main.js`**\r\n```js\r\nimport logger from './logger'\r\nVue.use(logger)\r\n// note that you may also provide the options argument here as well\r\n// if provided, they would be merged with / override the options already applied\r\n```\r\n\r\nMore information about hooks can be found in the [Hooks](#Hooks) section.\r\n\r\n## Options\r\n\r\n**Name**|**Type**|**Default**|**Description**\r\n:-----|:-----|:-----|:-----\r\nenabled | boolean | true | enable/disable logger\r\nconsoleEnabled | boolean | true | enable/disable console output\r\nlevel | string | 'debug' | the logging level (one of: debug, info, warn, error, log)\r\ncallerInfo | boolean | false | whether information about the caller function should be included\r\nprefixFormat | string | *(see [below](#prefixFormat))* | provide a custom formatted string for the log message prefix (preceeds the log arguments)\r\nbeforeHooks | LoggerHook[] | [] | hooks invoked before a statement is logged, can be used to alter log arguments (use carefully)\r\nafterHooks | LoggerHook[] | [] | hooks invoked after a statement is logged\r\n\r\n### **Levels**\r\n\r\nlog <-- error <-- warn <-- info <-- debug\r\n\r\n_(from left to right: least inclusive to most inclusive)_\r\n\r\nSpecify an appropriate level to limit the amount of information logged.  For example, using the 'warn' level will log the 'log', 'error', and 'warn' events but not the 'info' or 'debug' events.\r\n\r\n> Note: Depending on your browser, the debug level may be labeled as \"Verbose\" instead of \"Debug\".  Ensure this level is enabled if looking for debug logs in the browser console.  Chrome uses verbose for these logs, see docs [here](https://developer.chrome.com/docs/devtools/console/log/#browser).\r\n\r\n### **enabled vs consoleEnabled**\r\n\r\nSetting `enabled` to false will disable all logger functionality (console output + hook invocations).\r\n\r\nSetting `consoleEnabled` to false will disable just the console output but will still invoke the hooks.\r\n\r\nSo, for example, if you want to prevent writing logs to the browser console but still invoke a hook (i.e. to send logs to a server) then you would set `enabled: true` and `consoleEnabled: false`.\r\n\r\n### **callerInfo**\r\n\r\nSetting `callerInfo` to true will result in caller function information (fileName, functionName, lineNumber) being determined and included in the log, as well as being included in events provided to hooks, for each log function invocation.\r\n\r\n### **prefixFormat**\r\n\r\nUse the `prefixFormat` option to customize the message prefix (portion of log statement that appears before the arguments provided to the log function).\r\nThis can as well be used to inject additional information into the message prefix, such as timestamps or user identifiers for example.\r\n\r\nThe value of this option must be a function which accepts a partial LogEvent object and returns a string.  The provided LogEvent object contains only log `level` and `caller` information.\r\n\r\nThe default for this option is:\r\n```typescript\r\nprefixFormat: ({ level, caller }) => (\r\n    caller\r\n      ? `[${level.toUpperCase()}] [${caller?.fileName}:${caller?.functionName}:${caller?.lineNumber}]`\r\n      : `[${level.toUpperCase()}]`\r\n  )\r\n```\r\n\r\n## Hooks\r\n\r\nHooks allow for advanced customization of the logger implementation, providing operations to be run before and after logging is performed.  These are defined on options as ```beforeHooks``` and ```afterHooks```.\r\n\r\n### beforeHooks\r\nInvoked before a statement is logged, can alter the log arguments which can impact the log output.\r\n\r\n### afterHooks\r\nInvoked after a statement is logged, cannot impact the log output.\r\n\r\n### Built-in Hooks\r\nThe following hooks are available in this package and can be used by simply importing and adding them to the beforeHooks and/or afterHooks arrays of your options.\r\n\r\n**`StringifyObjectsHook`**\r\nApplies JSON.stringify on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [ StringifyObjectsHook ]\r\n}\r\n```\r\n**`StringifyAndParseObjectsHook`**\r\nApplies JSON.stringify and JSON.parse on all objects provided as arguments to a logging method.\r\n```js\r\nimport { StringifyAndParseObjectsHook } from 'vue-logger-plugin'\r\nconst options = {\r\n  // ... (other options)\r\n  beforeHooks: [ StringifyAndParseObjectsHook ]\r\n}\r\n```\r\n\r\nThe above are best used as 'before hooks' as they may purposefully alter the log output.  This way you are sure you are seeing the value of an object at the moment you log it. Otherwise, many browsers provide a live view that constantly updates as values change.\r\n\r\n### Write Your Own Hooks\r\n\r\nYou can easily write your own hooks to apply custom logic.  A hook must implement a ```run``` function to handle a log event (an object containing the log level and the array of arguments which were passed to the logging method), and may optionally implement an ```install``` function which is invoked during plugin installation (or at the time of logger options application - see [Usage](#usage) section).\r\n\r\nFor reference, here are the interfaces:\r\n```ts\r\nexport interface LoggerHook {\r\n  run (event: LogEvent): void\r\n  install? (options: LoggerOptions): void\r\n  props?: { [key: string]: any }\r\n}\r\nexport interface LogEvent {\r\n  level: LogLevel // 'debug' | 'info' | 'warn' | 'error' | 'log'\r\n  argumentArray: any[]\r\n  caller?: CallerInfo\r\n}\r\nexport interface CallerInfo {\r\n  fileName?: string\r\n  functionName?: string\r\n  lineNumber?: string\r\n}\r\n```\r\n\r\n#### Sample Custom Hook - Leveraging Axios to Send Logs to Server\r\nThis is a basic example demonstrating how you could have the logger send log data to a server using an Axios client.\r\n\r\n**`logger/index.ts`**\r\n```ts\r\nimport VueLogger, { LoggerOptions, LoggerHook, LogEvent } from 'vue-logger-plugin'\r\nimport axios from 'axios'\r\n\r\nconst ServerLogHook: LoggerHook = {\r\n  run(event: LogEvent) {\r\n    axios.post('/log', { severity: event.level, data: event.argumentArray })\r\n  }\r\n}\r\n\r\nconst options: LoggerOptions = {\r\n  // ... (other options)\r\n  afterHooks: [ ServerLogHook ]\r\n}\r\n\r\nexport default new VueLogger(options)\r\n```\r\n\r\n## Usage\r\n\r\nOnce installed, the logger is available within the Vue instance via both ```$log``` and ```$logger``` (both access the same logger instance and provide the same functionality).\r\n\r\n```js\r\nnew Vue({\r\n  created: function() {\r\n    const testObject = {\r\n      name: 'test',\r\n      value: 'this is a test object'\r\n    }\r\n    // using $log\r\n    this.$log.debug('Test Message', testObject)\r\n    this.$log.info('Test Message', testObject)\r\n    this.$log.warn('Test Message', testObject)\r\n    this.$log.error('Test Message', testObject)\r\n    this.$log.log('Test Message', testObject)\r\n    // using $logger\r\n    this.$logger.debug('Test Message', testObject)\r\n    this.$logger.info('Test Message', testObject)\r\n    this.$logger.warn('Test Message', testObject)\r\n    this.$logger.error('Test Message', testObject)\r\n    this.$logger.log('Test Message', testObject)\r\n  }\r\n})\r\n```\r\n\r\nAs described in the Vue Plugin Install section above, options can be provided to the VueLogger constructor and/or to the Vue.use method for customizing the logging implementation.  As well, options can be applied at any time to the logger on the Vue instance via the ```apply``` method.  This allows for on-demand enabling/disabling of the logger and adjusting log levels as needed from within your components.\r\n\r\n```js\r\nthis.$log.apply({ level: 'info' }) // applies log level\r\n```\r\n\r\n```js\r\nthis.$log.apply({ enabled: false }) // disables logging\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n[npm-image]: https://img.shields.io/npm/v/vue-logger-plugin/1.x-latest.svg\r\n[npm-url]: https://npmjs.org/package/vue-logger-plugin\r\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\r\n[license-url]: LICENSE\r\n[codecov-image]: https://codecov.io/gh/dev-tavern/vue-logger-plugin/branch/develop-v1/graph/badge.svg?token=WZDGBNBIW5\r\n[codecov-url]: https://codecov.io/gh/dev-tavern/vue-logger-plugin\r\n[circleci-image]: https://circleci.com/gh/dev-tavern/vue-logger-plugin/tree/develop-v1.svg?style=svg\r\n[circleci-url]: https://circleci.com/gh/dev-tavern/vue-logger-plugin?branch=develop-v1\r\n[minified-image]: https://badgen.net/bundlephobia/min/vue-logger-plugin@1.x-latest\r\n[minzipped-image]: https://badgen.net/bundlephobia/minzip/vue-logger-plugin@1.x-latest","readmeFilename":"README.md","gitHead":"a2a4278d1562439297a80491e3e99bf192949565","bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"_id":"vue-logger-plugin@1.2.3","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-xolZPxLlr3n9CobfIdPtc1i5k607Yav1DmKk29mQCkfxnFMPCiCO9akhF0+A84YEeZUQFtN1Z/j3ShlRXubSpQ==","shasum":"95976caefa6e6545252161280811305f55b8b09e","tarball":"https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-1.2.3.tgz","fileCount":15,"unpackedSize":34160,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHAuD66v9Lix9Ypp3uaS6dLzBl3gFYUZkHuCGbAEDEggAiEAutG2KMeP9DSP44iQPV0fQdSlcYTQm5EAFyW68Jz3BUE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitnj7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowEQ//fFEzHpih8Z9PKLmO4V97yWeZVIVYg2vujcD2lWvhZtey9Sr3\r\nmIVOB188gJbKzg+BpBDv1AOLWnKtjypMgrmHI0b9qfT1vAagaAarasI+1bGY\r\nLcMBWmtMdhK0PqdP0DJDYFEGKs/KKmrpnvkhzthT9DupQ/axL/L6cuNS0uzE\r\n3sMYkLvu2+AtChLYctQZUzqPpY4eRfXaXMTyEtx3iujiR0v2HzHDFAqRv60u\r\nDbTmT9Hkwa/4DxttefjhIGD71w55U2AgA+VC+zt7GILKVB1My2oB3V32oHfu\r\nzhWFhSHvM3p+Vr2PCa2pjWj+zgE2BlMSTZe0Ee5pxfnLh7fUNfOdPPnZXv9b\r\nDvKFYx8qXssv5FVpxiTTAfx9XD0+V6WngxBLWOkT02qvu+03tqPqt79YlNQ/\r\nTMmSGOKHqZxRaXVCd9OzztZj8df2MLqTlWyYj0RmoJXqDDst2mGBsXQlsJM7\r\nmmnqXxyWz27COPYTxSLyaUz7Ho79sv6v1O6bDKjr0Tr06+Sm3bmjcNXVIv0B\r\n0JpCqjdqxxLBESqR2HVq9XudRZ8FCdzlj8H+l6DBzeeajKLNJjsVdFskm2qZ\r\nOViQ2VgGHv6276Lk5DKal5JUKeCEuMgYf7YG8VDU0Yv59f7u2rf9eH9j28M3\r\nRenC+7zwgqaR9LyQpSWGKVQ/lhX1f+xj5Q4=\r\n=wynF\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"joshgamble","email":"jogamble07@gmail.com"},"directories":{},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-logger-plugin_1.2.3_1656125691715_0.32044530982579356"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-31T21:11:34.822Z","1.0.0":"2020-03-31T21:11:34.935Z","modified":"2022-06-26T00:14:07.671Z","1.0.1":"2020-07-23T00:55:56.522Z","2.0.0-beta.0":"2020-08-10T01:03:36.327Z","2.0.0-beta.1":"2020-09-11T22:15:25.343Z","2.0.0":"2020-09-21T03:05:02.741Z","1.1.0":"2021-05-02T02:30:23.963Z","2.1.0":"2021-05-02T02:45:25.854Z","2.1.1":"2021-05-05T00:55:49.089Z","1.1.1":"2021-05-31T04:08:41.486Z","2.1.2":"2021-05-31T04:11:43.176Z","1.1.2":"2021-08-15T17:32:20.366Z","2.1.3":"2021-08-15T17:50:12.773Z","2.1.4":"2022-01-25T03:28:53.278Z","2.2.0":"2022-02-06T01:26:20.849Z","1.1.3":"2022-02-06T02:57:58.757Z","1.2.0":"2022-02-06T05:20:03.203Z","1.2.1":"2022-02-10T04:27:49.615Z","2.2.1":"2022-02-10T04:29:07.217Z","2.2.2":"2022-03-03T00:42:53.761Z","2.2.3":"2022-05-25T03:09:40.417Z","1.2.2":"2022-05-25T03:53:43.536Z","1.2.3":"2022-06-25T02:54:51.893Z"},"maintainers":[{"name":"joshgamble","email":"jogamble07@gmail.com"}],"description":"Flexible logging functionality for Vue.js 2 & 3","homepage":"https://github.com/dev-tavern/vue-logger-plugin#readme","keywords":["vue","vue 2","vue 3","logger","logging"],"repository":{"type":"git","url":"git+https://github.com/dev-tavern/vue-logger-plugin.git"},"author":{"name":"Josh Gamble"},"bugs":{"url":"https://github.com/dev-tavern/vue-logger-plugin/issues"},"license":"MIT","readme":"","readmeFilename":""}