{"_id":"@alfa-wells/alfa-logger","_rev":"3-9a56d910bbbdd962b541ac327ddbad56","name":"@alfa-wells/alfa-logger","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@alfa-wells/alfa-logger","version":"0.1.0","description":"Event logging for Alfa","main":"index.js","scripts":{"test":"mocha"},"author":{"name":"leolobeto"},"license":"ISC","dependencies":{"fs-extra":"^7.0.1","winston":"^3.1.0","winston-daily-rotate-file":"^3.5.1"},"_id":"@alfa-wells/alfa-logger@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"leolobeto","email":"leolobeto@gmail.com"},"dist":{"integrity":"sha512-/oSsB245d9r4xXXvYQX/g7EtEgw+/3oFt61fVQwd57NVWHkwo1JNcSIzAAcMmAP1NsiaLWOcFyCrpWdspD87Rw==","shasum":"4fedc337304f3d77caf6440c2af7000760ff58e8","tarball":"https://registry.npmjs.org/@alfa-wells/alfa-logger/-/alfa-logger-0.1.0.tgz","fileCount":4,"unpackedSize":5693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9jVKCRA9TVsSAnZWagAATMUP/3a1c39GZvRlUps3QNuk\nCG8nJCQ0nQ/NUYrnnhLJR4QU/cKfYBH+SDjcEOFKvfTe4ZCo2iVVCMY5Divs\nS9hAr7yQkQ5j18AMx1vACo0nbeNpWdO1EMFLtfHRKcI+WW9q3DD0JkcHmSEr\npB7WesASytCJ7jvVLRFfLtL7TN350PU4R3zs0vr+LgJWKcEiZHYPk+DmS4zI\nHtFGW0LqQnI7yPXnkPhovTaIxmRyMjthqx3O0dkm4WCfim+e4Q8CbiBBKeuf\nNx5jjelstQTdSXW7N0mx+8Qe3puvKoJTq6k5WmByzL2LsoDZYQeO0b2Mxe4U\nE5ZXj7WH4sAowQAkX6Qm1HWP+KN+PKwtkWatq4vHmbyWbJsQL1TaKGYzQv/G\nXRsKJk3TMYH2h+aa8JSQEmB85IH3hDxMuAKAoVW30X2RYw7tC0K+nH4W6Jbd\nSmAqRug2QMkIHfxu0/E8Kc3nS+mdwBzerbHB5nDC3BXvQVGMt10lbF2xSJ+w\nFHigVqYfuowvT/xwhae/xnwGoKE9ubnYF3pIUJXfy/ZjBVgT6YEE9zWCVlDz\n0yS/dOnGGGt2gJalhy2KtBa8x7TyrD6Ci+iFHaQo2SXCDnoJxHnkf+ZOWiFR\nOQhnlT8fWZzPZTAdCxrziktXF7w8GLm3vOK7niXUyBde/AloInaA2tHJ3L/x\nepY1\r\n=FwYM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBDmxZm4LTDpivr7klaQ+4uVtgGkNr/ffWjYHiHPdzn1AiEAlsbsurSg6cX267Phr5waKvIXJEqSEcPXp2BVRyUmjuE="}]},"maintainers":[{"name":"leolobeto","email":"leolobeto@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfa-logger_0.1.0_1542862154195_0.6653050158717402"},"_hasShrinkwrap":false},"0.1.1":{"name":"@alfa-wells/alfa-logger","version":"0.1.1","description":"Event logging for Alfa","main":"index.js","scripts":{"test":"mocha"},"author":{"name":"leolobeto"},"license":"ISC","dependencies":{"fs-extra":"^7.0.1","winston":"^3.1.0","winston-daily-rotate-file":"^3.5.1"},"_id":"@alfa-wells/alfa-logger@0.1.1","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"leolobeto","email":"leolobeto@gmail.com"},"dist":{"integrity":"sha512-/gQSzx0qTuMdUwJhmbWeBUkFybGSX+0jDtFGt5udgkVoQdFHW5QNQXKFzl08iKUJQGcEh2YR5CgBHPBdZUYKDw==","shasum":"440fbe92d27717b282ef4462b07538c00ad130f8","tarball":"https://registry.npmjs.org/@alfa-wells/alfa-logger/-/alfa-logger-0.1.1.tgz","fileCount":4,"unpackedSize":5778,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcIxkhCRA9TVsSAnZWagAAFKgP+gOt1qQbU4YYm/4t5AFs\nMenLQMlwWyfetrGxZtpf0POwf4AeTEBkqKNz4whx9cgogP/RWqHgyAvW+sT0\nzALN8tdVbHbZFQ2WjNJQb0ZYBNcR8V9Da55ST0us6PQ7YnzPR+wo7NuIRFS4\ngb22oAXzibKYHxG4hZumTI+kpDKE6zagNo1qMuqX4KRY3dWyc050XTwziqgh\nHs6Np9Vw4bQXbARnurh+8aoG/+IgKH/oL/v9mq+9NqBtFroDEt9CsBfNd0DJ\niX934lqUdzr5lMuAg5gS1ZXej9kxzmIDB/jWzo+h85/f0vFK91jcnZTMJbCc\neBi/3f2VlaTH1uEz1I2yQY7Qh/SiFUZRz7s7C7h9Wm/6pqvoSwFeT8kSDmWv\nVmPwce0s/mcIdY9xomKSyfx6ix2qpUI99VqTMleRw2eAibOmOqH0FB9bir2v\n+52aCOkccei4IpfVC3VnQFH1m+nwnyE5HB3/NorjbHMkbiIGtj8hIj1/VCyd\nLG84+x/Ysfb2CH47/Ub/gL8urrlqgXR9fGfESfHG6eXdZuoprVXs/fC5sSPh\n2wBOk/60nPYoQ6Xezj+UmJHGhokCOZytfp6fXrgFAF9p6HVtEU4FGqrbJNvy\nQhRNul/uaFV71+LlXwhKVpdZh6RKFB2KnnLQIPW4PT+CxTSoA/F8vNHmw5hc\n7xEe\r\n=8eFr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGaXnW8nbkigmAy+DAtdy4twZ7Cl+mrkDf9TOMujGMigIgWKae1LN9KYjKeMEYGnZB073/YDE5e+0pUjUYkDqlIxY="}]},"maintainers":[{"name":"leolobeto","email":"leolobeto@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfa-logger_0.1.1_1545804064402_0.4195961441953997"},"_hasShrinkwrap":false},"0.2.0":{"name":"@alfa-wells/alfa-logger","version":"0.2.0","description":"Event logging for Alfa","main":"index.js","scripts":{"test":"mocha"},"author":{"name":"leolobeto"},"license":"ISC","dependencies":{"fs-extra":"^7.0.1","winston":"^3.1.0","winston-daily-rotate-file":"^3.5.1"},"devDependencies":{"@types/mocha":"^5.2.5"},"gitHead":"bffb171281dbe75f6acfc92d1dae8e78b5dd45c2","_id":"@alfa-wells/alfa-logger@0.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"leolobeto","email":"leolobeto@gmail.com"},"dist":{"integrity":"sha512-c2yT6Qf7FoXK4+NHgPa8F36pX/KxVlrhjC48ySexZ3MiQ7pM6RjfpUQC62+FDzf9DCsbN6SBJ8JuJR7c46hnIw==","shasum":"f356b4f36cd64c92dde3af775d9a6e3224a93ac1","tarball":"https://registry.npmjs.org/@alfa-wells/alfa-logger/-/alfa-logger-0.2.0.tgz","fileCount":5,"unpackedSize":7034,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPDm5CRA9TVsSAnZWagAA1h4QAJaiOis/PkuzW+oBNXr7\nl9Cc4yrcwgJRrz4kcZgffuknepcqPUuPS8RUwhs2HLx+VawEDxnEC1gLwn7g\n9EtCmNJROksLPE/ipjRzp8Ry7c8Mt9FxaEEPW/8N0QjAhbephteZNGHK/arC\nB+1zYUq8Lx6551vBUcoPcr1/NpSv6cTtF4QmpyzlWm4LXEz1uuYDjdKB3/TJ\nEVMoFLA8LA4+HZum1VLfEHnPybMbbJJp9RVK917QskfrN4VWiWt2uC9PQdTk\n+GfRB7+KS0QJdCgt+zAZEr9qkxykUx6bIPHOEhcs36WDA78PmyunPyEELEs6\n+HUAqRJSX7373SXLVAvTf/gIqB/I3w0GrRe7NIdSPMV4Pt4O54F5k+GEaiIF\nT82liz7vwG1KtMgfT3pTVt2g9ALJQCNd1iYdSuJmMw8zvyFSuR8gVuCFWffK\nKo135KlB3peBUX2HmR1/v54MPNGpFiyCxrA87AmLMxDddTDQl/OMEgI01FLD\nWz9adEe6zilGAya7J17YtSD3a7hrC3NaYo3JNnNtE4aXMgHUBO/rJ2Jek2mb\nq2del/XGswHsSYQwadSiOzBc+NaTj5vH966NU/+P2utQsiaemvHyWe+k2xE5\nfpq/sg4tkI8toQOu/XGkJhIqluw9EKlxKzJ1dihjDbr/Ia/jUR8esCrRu3GY\nNVuA\r\n=TquG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGh/PC85n0Lnk9R/FvIas7+RHxb/JmyX+KT4DaZNrcREAiBazFTkoLK1G/05yII6YQUeG4WLO0mcQZ6scvWWCqJtwQ=="}]},"maintainers":[{"name":"leolobeto","email":"leolobeto@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfa-logger_0.2.0_1547450808510_0.028492792367364794"},"_hasShrinkwrap":false}},"time":{"created":"2018-11-22T04:49:14.033Z","0.1.0":"2018-11-22T04:49:14.337Z","modified":"2022-04-04T12:42:05.264Z","0.1.1":"2018-12-26T06:01:04.505Z","0.2.0":"2019-01-14T07:26:48.595Z"},"maintainers":[{"name":"leolobeto","email":"leolobeto@gmail.com"}],"description":"Event logging for Alfa","author":{"name":"leolobeto"},"license":"ISC","readme":"# Alfa-Logger\r\nPreconfigured logger for Alfa Project.\r\n\r\n## How to use\r\n### Set Up\r\n\r\n    npm install @alfa-wells/alfa-logger --save\r\n\r\nFirst of all, set a folder to drop log files in. Do this at the very begining of your program.\r\n\r\n````js\r\n    const Logger = require('@alfa-wells/alfa-logger')\r\n    Logger.toFolder(\"/path/to/log\")\r\n````\r\n\r\nIn production (environment variable `NODE_ENV` has value `production`) folder is created if not exist and log files are created there. Files are rotated dialy and old files are conserved for 5 days and finally deleted.\r\nWhen not in production environment, logs to the console, ignoring the folder.\r\nLog level is also preconfigured based on environment. In production, only `error` and `warn` are logged. When not in production, all levels are shown.\r\n\r\n### Begin To Write\r\nIn your program files, just write:\r\n````js\r\n    const Logger = require('@alfa-wells/alfa-logger')\r\n    \r\n    Logger.debug(\"This is my first message\")\r\n    //[2018-11-22T04:08:55.017Z] DEBUG: This is my first message\r\n    \r\n    Logger.error(\"This is my first error\")\r\n    //[2018-11-22T04:09:55.017Z] ERROR: This is my first error\r\n    \r\n    try {\r\n        (null).jump()  //\r\n    } catch(err) {\r\n        Logger.error(err)\r\n    }\r\n    //[2018-11-22T04:22:19.249Z] ERROR: TypeError: Cannot read property 'jump' of null\r\n````\r\nAvailable methods/levels, sorted from less to more important are:\r\n* `silly`\r\n* `debug`\r\n* `verbose`\r\n* `info`\r\n* `warn`\r\n* `error`\r\n \r\nAll of then takes `any` as argument.\r\n\r\n### Scoped Loggers\r\nIn previous examples a global logger is used. In practice, it is recommended to do all your stuff with a scoped logger. An scoped logger is exactly like the global logger but it's created with a label which is shown at the begining of every message.\r\n\r\n````js\r\n    //Notice the scope as an argument at the end of this line\r\n    const Logger = require('@alfa-wells/alfa-logger')('my-nice-module')\r\n    \r\n    Logger.debug(\"This is my first message\")\r\n    //[2018-11-22T04:08:55.017Z][my-nice-module] DEBUG: This is my first message\r\n    //                           ^--- Here it is!\r\n````\r\n","readmeFilename":"readme.md"}