{"_id":"@404invalid-user/logger","_rev":"1-e2e0b1c8af524b0c9c734004c36b6b23","name":"@404invalid-user/logger","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@404invalid-user/logger","version":"1.0.0","description":"a simple logger that also has webhooks","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"prepublish":"npm run build","build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"404invalid-user","url":"invaliduser@bruvland.com"},"license":"MIT","dependencies":{"axios":"^0.27.2","moment":"^2.29.3"},"devDependencies":{"@types/axios":"^0.14.0","@types/node":"^17.0.34","typescript":"^4.6.4"},"gitHead":"540112fed6fb94f300289bd75782b5eb93995f2e","_id":"@404invalid-user/logger@1.0.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-3+6iXypwN9xds8ASaoLQzhhVS/l3Z2y9t6WRYLRM1pkYSZsVCQFBZEyFaSe+rfBYmRULNFo6PI6//6Kak4DWkQ==","shasum":"333b666ad2ee9a7bc2ead8f5a8c493dba3cbdced","tarball":"https://registry.npmjs.org/@404invalid-user/logger/-/logger-1.0.0.tgz","fileCount":30,"unpackedSize":45156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfN1bMHDOVRPr95stpjaRLAbv8sEbzjU9KDVV1s0bacwIhALnG/XCdQDvcmokmxmAXQe6Gw0qxcPoSiQgyc9WWRE+q"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihhLQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+WBAAgk/5Fld+xrAcg5kjmBy2HWBEXRuKEEt1OikDYWnxw5FSdqWd\r\nuRGQ1UVsZdB/0s6jaAPuAYpoLNdIRkxwD+nyNPTFNyS4cuaWMcvaIq4MOpjG\r\nAq4vjZ9R+1Gdyv4tXIPgMgnrRiwaaf793NjucvV3jplzVN/JVlvGalmxgbUj\r\naxvah4rIwvjHq0P11Gsfzi8xQLac/kAoWVx/f/r1er0alP0gDgfmplpqXCih\r\nXlA6ZJGCmPU7iI+3GijXN7w9l2WeAEKcfSg1swqz1qivingfrTBZw0FbCrG8\r\n/O6F1ekdM9m2+jBi3cEOlscR99XfKfWCg181HKIrjSml3Sy7oFjYWQ5f0VEl\r\nEG2N4vod/S+AX8uJbz7TPzquCED91qXSCA2g4HzZ7ED8m3Cs7cktU3Ip+HJ4\r\nQJh8mHWL7EFviLnD28L0ONbM2NuTe9DRVNCyRdDVRuOlRecOsWdPLZNGbC97\r\nDGFj3TErDvIuDKgrX3m2EGskgJoSDDhNs2ppK1y+QwAdwPUKO3JeY9U2MC7D\r\nEaXFof24/zBXz/hUJCsa4isxlDTGpO/OxRI8iAvtNJxynj900t/kwkK2jr7I\r\nNMwb0LiGy6lONiOb3zL/7hHmFBZEF0quGlM/okAIJBS2uRKfL+41FmYNl/+C\r\nluJLTmFp+2E1LTrarb4F5sG/fyNVtmCjVmA=\r\n=cL6o\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"404invalid-user","email":"user@invalidlag.com"},"directories":{},"maintainers":[{"name":"404invalid-user","email":"user@invalidlag.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logger_1.0.0_1652953808680_0.6012979282202866"},"_hasShrinkwrap":false},"1.0.1":{"name":"@404invalid-user/logger","version":"1.0.1","description":"a simple logger that also has webhooks","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"prepublish":"npm run build","build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"404invalid-user","url":"invaliduser@bruvland.com"},"license":"MIT","dependencies":{"axios":"^0.27.2","moment":"^2.29.3"},"devDependencies":{"@types/axios":"^0.14.0","@types/node":"^17.0.34","typescript":"^4.6.4"},"gitHead":"019c478037ca260ab44aa5bca384659dc99945f0","_id":"@404invalid-user/logger@1.0.1","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-Myawq7BIuoc27MJEJwMBFrmGLLeItFhw/RII+/nXf6yCfxAWCKZM0nY+hACo9JnJxBejIPhIv4s0wB9G4cj2DQ==","shasum":"e7f26efcfd04c587fc16c7e0a5a0453864648fae","tarball":"https://registry.npmjs.org/@404invalid-user/logger/-/logger-1.0.1.tgz","fileCount":18,"unpackedSize":42555,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCm/vXDaLJL4imLSVODCKHQ6Gl1XACIA7gnDaWM03i9bgIgY6PkVznz/RLeKIZy0d4acJvtgWStiPKUIGjmyyXHS48="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimMXhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoI7Q/7B/+XODuAbwUnA2/IfRGOnIiQ8e7Vq69szdjBGUe5Fuzs71nk\r\n/BO5htTjZCbIzDyqpA+ceIehtfN5QLdTr8o03HeoxOEEubqgp4smxx6ourBC\r\nqJj5foUvu7HdouQbnAzxUCrNBEV43m0oi7ZEfvqIzMPE99vxvuIwU1lnbnRB\r\nVaFrUkNFyqb9SOMm1IM4+hg00v5CybwxwBM/+/hv9VzaZLxw2KPQonX9atB1\r\npyGfEvsNPogDmb4J97d/UUxsy9KLjdR1jbL5+dlAn6QNmFtgZUUr0sIRTXmN\r\nbktWc1SkASgti0huYm7LLV8+tMmp+g/FGyv0EV2akDtOBAjFwgoHOUIcLQJY\r\ncG6Wa1ZmIAS3P/PoAyGq7XOCq6KTUtBp5XyZqSjfvErtVODSKerdpJU1fYil\r\nDpV+G70uXdl/5PHBvJjO2AD/VwQow4lWFubB67AThRq5Qc9aQZfX2gzlLbpt\r\nEXsU8XXIjHYkLl33SWN9yJt9ku9rz5LSTBEUgBJMJS0+JomB9uLNwS4IQ457\r\n4ZWu018SnuNSW3TJkUbab3oC3hyfGn8L99H253d0KroWzE50MznKr22rqByv\r\nXk5pGbe/A6lU65DBEiaKtc6FgEtD/0h/IZIzu9IZKa3WKmN8pePQhWmU4W5E\r\n9+QzL00+I0snoyPXMNnTw1tTCdWkN7wcHmg=\r\n=mHzh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"404invalid-user","email":"user@invalidlag.com"},"directories":{},"maintainers":[{"name":"404invalid-user","email":"user@invalidlag.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logger_1.0.1_1654179297475_0.0034897219026837067"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-19T09:50:08.572Z","1.0.0":"2022-05-19T09:50:08.834Z","modified":"2022-06-02T14:14:57.700Z","1.0.1":"2022-06-02T14:14:57.623Z"},"maintainers":[{"name":"404invalid-user","email":"user@invalidlag.com"}],"description":"a simple logger that also has webhooks","author":{"name":"404invalid-user","url":"invaliduser@bruvland.com"},"license":"MIT","readme":"# logger\n\na simple logger for nodejs that allows you to log to a file and a to many platforms using webhooks.\n\n## examples\nsome examples to get you started.\n  <br>\n\n### basic\na simple logger\n```js\n\nconst {BasicLogger} = require('@404invalid-user/logger');\n\nconst  logPath = './logs.log';\nconst  allowDebugLogs = true;\nconst  log = new BasicLogger(logPath, allowDebugLogs);\n\nlog.success(\"app is running\");\nlog.info(\"app is still running\");\nlog.debug(\"line 8\");\nlog.warn(\"app will be stopping\");\nlog.error(\"app has stopped\");\n```\n<br>\n<br>\n### advanced\n\na more advanced logging system with more options please see the docs for more details on confg options.\n```js\nconst {AdvancedLogger} = require('@404invalid-user/logger');\nconst  loggerConfig = {\n  filePath:\"./logs.log\",\n  webhook: {\n    discord:  \"https://discord.com/api/webhook/blblbalabla\",\n  },\n  debug:true\n}\n\nconst  log = new AdvancedLogger(loggerConfig);\n\nlog.success(\"app is running\");\nlog.info(\"app is still running\");\nlog.debug(\"line 14\");\nlog.warn(\"app will be stopping\");\nlog.error(\"app has stopped\");\n\n```\n<br>\n<br>\n\n### using console\nits very simple instead of doing `const log = AdvancedLogger(loggerConfig);` you would do `console = AdvancedLogger(loggerConfig);`\n```js\n\nconst {AdvancedLogger} = require('@404invalid-user/logger');\nconst  loggerConfig = {\n  filePath:\"./logs.log\",\n  webhook: {\n    discord:  \"https://discord.com/api/webhook/blblbalabla\",\n  },\n  debug:true\n}\nconsole = new AdvancedLogger(loggerConfig);\n\nconsole.log(\"starting app\");\nconsole.success(\"app is running\");\nconsole.info(\"app is still running\");\nconsole.debug(\"line 14\");\nconsole.warn(\"app will be stopping\");\nconsole.error(\"app has stopped\");\n\n```\n\n\n## docs\n\n### config options\n\nthe config will be a object passed into the AdvancedLogger class.\n\neach function will have its own object with the name of that function each function config object is the same so i will just use success for this example.\n\nfirst you can disable each logging function by passing false instead of the object.\n```js\n//example\nconst {AdvancedLogger} = require('@404invalid-user/logger');\nconst  loggerConfig = {success:false}\nconst  log = new AdvancedLogger(loggerConfig);\n\n//will not do anything\nlog.success(\"app is running\");\n//will work as normal\nlog.info(\"app is still running\");\n```\n\neach function object will have this schema.\n```json\n{\n   \"logPath\": \"relative/path/from/app.dir\",\n   \"color\": \" your log name text colour see colours\",\n   \"textColor\": \"the colour of the text your logging see colours\",\n   \"webhook\": {\n       \"discord\":\"a discord webhook url\",\n       \"googleChat\":\"a google chat webhook url\"\n   }\n}\n```\nfor a full example of all the functions in action please see /examples\n\n\n \n\n#### class\n```js\n.BasicLogger(logPath: string, allowDebugLogs: boolean)\n```\n>>a basic logger to get the job done.\n>\n> returns an instance of the basic logger\n\n<br>\n\n#### class\n```js\n.AdvancedLogger(configOptions: object)\n```\n>>the configurable logger\n>\n> returns an instance of the advanced logger.\n\n<br>\n\n#### function\n```js\n.success(text: string)\n```\n>>send a success message to the console and log file if specified.\n>\n> returns null\n\n<br>\n\n#### function\n```js\n.info(text: string)\n```\n>>send a info message to the console and log file if specified.\n>\n> returns null\n\n<br>\n\n#### function\n```js\n.debug(text: string)\n```\n>>send a debug message to the console and log file if specified for debugging default is off so none of these will get logged in production.\n>\n> returns null\n\n<br>\n\n#### function\n```js\n.warn(text: string)\n```\n>>send a warning to the console and log file if specified.\n>\n> returns null\n\n<br>\n\n#### function\n```js\n.error(text: string)\n```\n>>send a error message to the console and log file if specified.\n>\n> returns null\n\n<br>\n\n#### function\n```js\n.crash(text: string)\n```\n>>send a crash message to the console and log file if specified.\n>\n> returns null\n\n<br>\n\n#### function\n```js\n.log(text: string)\n```\n>>a simple plain old log console and log file if specified for if you chose to redefine console as this to the.\n>\n> returns null\n","readmeFilename":"readme.md"}