From 127abddb4db36116ab48b9213a19b759a40ac941 Mon Sep 17 00:00:00 2001 From: "dr.dimitru" Date: Fri, 1 Feb 2019 23:44:37 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20v2.0.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 🤝 Compatibility with `meteor@1.8.0.2` - 📦 Update `fs-extra` NPM lib to `v7.0.1` - 📦 Update internal Atmosphere dependencies - 📄 Documentation update - 🤓 Support for Windows, Linux, and MacOS environments --- .npm/package/npm-shrinkwrap.json | 12 +++---- .versions | 55 ++++++++++++++++---------------- README.md | 23 ++++++------- package.js | 13 ++++---- 4 files changed, 52 insertions(+), 51 deletions(-) diff --git a/.npm/package/npm-shrinkwrap.json b/.npm/package/npm-shrinkwrap.json index b35b5d3..640a808 100644 --- a/.npm/package/npm-shrinkwrap.json +++ b/.npm/package/npm-shrinkwrap.json @@ -2,14 +2,14 @@ "lockfileVersion": 1, "dependencies": { "fs-extra": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.0.tgz", - "integrity": "sha512-EglNDLRpmaTWiD/qraZn6HREAEAHJcJOmxNEYwq6xeMKnVMAy3GUcFB+wXt2C6k4CNvB/mP1y/U3dzvKKj5OtQ==" + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==" }, "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" }, "jsonfile": { "version": "4.0.0", diff --git a/.versions b/.versions index d252028..16cfd7a 100644 --- a/.versions +++ b/.versions @@ -1,50 +1,51 @@ allow-deny@1.1.0 -babel-compiler@7.1.1 -babel-runtime@1.2.2 +babel-compiler@7.2.4 +babel-runtime@1.3.0 base64@1.0.11 -binary-heap@1.0.10 -boilerplate-generator@1.5.0 +binary-heap@1.0.11 +boilerplate-generator@1.6.0 callback-hook@1.1.0 check@1.3.1 ddp@1.4.0 -ddp-client@2.3.2 +ddp-client@2.3.3 ddp-common@1.4.0 ddp-server@2.2.0 -diff-sequence@1.1.0 -dynamic-import@0.4.0 -ecmascript@0.11.1 +diff-sequence@1.1.1 +dynamic-import@0.5.0 +ecmascript@0.12.4 ecmascript-runtime@0.7.0 -ecmascript-runtime-client@0.7.1 -ecmascript-runtime-server@0.7.0 +ecmascript-runtime-client@0.8.0 +ecmascript-runtime-server@0.7.1 ejson@1.1.0 +fetch@0.1.0 geojson-utils@1.0.10 -http@1.4.1 id-map@1.1.0 -local-test:ostrio:loggerfile@2.0.6 +inter-process-messaging@0.1.0 +local-test:ostrio:loggerfile@2.0.7 logging@1.1.20 -meteor@1.9.0 -minimongo@1.4.4 -modern-browsers@0.1.2 -modules@0.12.0 -modules-runtime@0.10.0 -mongo@1.5.0 +meteor@1.9.2 +minimongo@1.4.5 +modern-browsers@0.1.3 +modules@0.13.0 +modules-runtime@0.10.3 +mongo@1.6.0 +mongo-decimal@0.1.0 mongo-dev-server@1.1.0 mongo-id@1.0.7 -npm-mongo@3.0.11 +npm-mongo@3.1.1 ordered-dict@1.1.0 -ostrio:logger@2.0.7 -ostrio:loggerfile@2.0.6 -ostrio:meteor-root@1.0.7 -promise@0.11.1 +ostrio:logger@2.0.8 +ostrio:loggerfile@2.0.7 +ostrio:meteor-root@1.0.8 +promise@0.11.2 random@1.1.0 reactive-var@1.0.11 reload@1.2.0 retry@1.1.0 -routepolicy@1.0.13 -socket-stream-client@0.2.1 +routepolicy@1.1.0 +socket-stream-client@0.2.2 tinytest@1.1.0 tracker@1.2.0 underscore@1.0.10 -url@1.2.0 -webapp@1.6.0 +webapp@1.7.1 webapp-hashing@1.0.9 diff --git a/README.md b/README.md index e1bd942..d45512b 100755 --- a/README.md +++ b/README.md @@ -28,17 +28,18 @@ import { LoggerFile } from 'meteor/ostrio:loggerfile'; ``` ## FAQ: + - __Q__: Where to find the log file? - __A__: On dev stage: `/static/logs`. On prod stage: `/assets/app/logs`. Change this behavior with `options.path` (*see below*) - __Q__: Log files are gone, why? - __A__: __All logs will be removed as soon as your application rebuilds or you run__ `meteor reset`. To keep your logs persistent during development use an absolute `path` outside of your project folder, e.g. `/logs` directory. Make sure selected directory is writable by node/meteor's process owner - ## Usage ### Initialization [*Isomorphic*] `new LoggerFile(LoggerInstance, options)` + - `LoggerInstance` {*Logger*} - from `new Logger()` - `options` {*Object*} - `options.fileNameFormat` {*Function*} - Log file name, use to adjust file creation frequency, arguments: @@ -75,11 +76,11 @@ const log = new Logger(); const LogFile = new LoggerFile(log, { fileNameFormat(time) { // Create log-files hourly - return (time.getDate()) + "-" + (time.getMonth() + 1) + "-" + (time.getFullYear()) + "_" + (time.getHours()) + ".log"; + return (time.getDate()) + '-' + (time.getMonth() + 1) + '-' + (time.getFullYear()) + '_' + (time.getHours()) + '.log'; }, format(time, level, message, data, userId) { // Omit Date and hours from messages - return "[" + level + "] | " + (time.getMinutes()) + ":" + (time.getSeconds()) + " | \"" + message + "\" | User: " + userId + "\r\n"; + return '[' + level + '] | ' + (time.getMinutes()) + ':' + (time.getSeconds()) + ' | \'' + message + '\' | User: ' + userId + '\r\n'; }, path: '/data/logs/' // Use absolute storage path }); @@ -149,11 +150,11 @@ window.onerror = (msg, url, line) => { const bound = Meteor.bindEnvironment((callback) => {callback();}); process.on('uncaughtException', (err) => { bound(() => { - log.error("Server Crashed!", err); + log.error('Server Crashed!', err); console.error(err.stack); process.exit(7); }); -}; +}); ``` ### Catch-all Meteor's errors example: [*Server*] @@ -182,10 +183,10 @@ const log2 = new Logger(); (new LoggerFile(log2, { fileNameFormat(time) { - return (time.getDate()) + "-" + (time.getMonth() + 1) + "-" + (time.getFullYear()) + "_" + (time.getHours()) + ".log"; + return (time.getDate()) + '-' + (time.getMonth() + 1) + '-' + (time.getFullYear()) + '_' + (time.getHours()) + '.log'; }, format(time, level, message, data, userId) { - return "[" + level + "] | " + (time.getMinutes()) + ":" + (time.getSeconds()) + " | \"" + message + "\" | User: " + userId + "\r\n"; + return '[' + level + '] | ' + (time.getMinutes()) + ':' + (time.getSeconds()) + ' | \'' + message + '\' | User: ' + userId + '\r\n'; }, path: '/data/logs/' })).enable(); @@ -193,10 +194,10 @@ const log2 = new Logger(); ## Support this awesome package: - - Star on [GitHub](https://github.com/VeliovGroup/Meteor-logger-file) - - Star on [Atmosphere](https://atmospherejs.com/ostrio/loggerfile) - - [Tweet](https://twitter.com/share?url=https://github.com/VeliovGroup/Meteor-logger-file&text=Store%20%23meteorjs%20log%20messages%20(from%20Client%20%26%20Server)%20in%20the%20file%20%23javascript%20%23programming%20%23webdev%20via%20%40VeliovGroup) - - Share on [Facebook](https://www.facebook.com/sharer.php?u=https://github.com/VeliovGroup/Meteor-logger-file) +- Star on [GitHub](https://github.com/VeliovGroup/Meteor-logger-file) +- Star on [Atmosphere](https://atmospherejs.com/ostrio/loggerfile) +- [Tweet](https://twitter.com/share?url=https://github.com/VeliovGroup/Meteor-logger-file&text=Store%20%23meteorjs%20log%20messages%20(from%20Client%20%26%20Server)%20in%20the%20file%20%23javascript%20%23programming%20%23webdev%20via%20%40VeliovGroup) +- Share on [Facebook](https://www.facebook.com/sharer.php?u=https://github.com/VeliovGroup/Meteor-logger-file) ## Support our open source contribution: diff --git a/package.js b/package.js index 8369fe2..68369b6 100755 --- a/package.js +++ b/package.js @@ -1,26 +1,25 @@ Package.describe({ name: 'ostrio:loggerfile', - version: '2.0.6', + version: '2.0.7', summary: 'Logging: Store application\'s logs into file (Server & Client support)', git: 'https://github.com/VeliovGroup/Meteor-logger-file', documentation: 'README.md' }); -Package.onUse(function(api) { +Package.onUse((api) => { api.versionsFrom('1.4'); - api.use('ostrio:meteor-root@1.0.7', 'server'); - api.use(['ecmascript', 'check', 'ostrio:logger@2.0.7'], ['client', 'server']); - api.use('underscore', 'server'); + api.use('ostrio:meteor-root@1.0.8', 'server'); + api.use(['ecmascript', 'check', 'ostrio:logger@2.0.8'], ['client', 'server']); api.mainModule('client.js', 'client'); api.mainModule('server.js', 'server'); }); -Package.onTest(function(api) { +Package.onTest((api) => { api.use('tinytest'); api.use(['ecmascript', 'underscore', 'ostrio:logger', 'ostrio:loggerfile']); api.addFiles('loggerfile-tests.js'); }); Npm.depends({ - 'fs-extra': '7.0.0' + 'fs-extra': '7.0.1' });