Skip to content

Commit

Permalink
📦 v2.0.7
Browse files Browse the repository at this point in the history
 - 🤝 Compatibility with `[email protected]`
 - 📦 Update `fs-extra` NPM lib to `v7.0.1`
 - 📦 Update internal Atmosphere dependencies
 - 📄 Documentation update
 - 🤓 Support for Windows, Linux, and MacOS environments
  • Loading branch information
dr-dimitru committed Feb 2, 2019
1 parent bd02235 commit 127abdd
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 51 deletions.
12 changes: 6 additions & 6 deletions .npm/package/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 28 additions & 27 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,50 +1,51 @@
[email protected]
babel-compiler@7.1.1
babel-runtime@1.2.2
babel-compiler@7.2.4
babel-runtime@1.3.0
[email protected]
[email protected].10
boilerplate-generator@1.5.0
[email protected].11
boilerplate-generator@1.6.0
[email protected]
[email protected]
[email protected]
[email protected].2
[email protected].3
[email protected]
[email protected]
[email protected].0
dynamic-import@0.4.0
ecmascript@0.11.1
[email protected].1
dynamic-import@0.5.0
ecmascript@0.12.4
[email protected]
ecmascript-runtime-client@0.7.1
[email protected].0
ecmascript-runtime-client@0.8.0
[email protected].1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
local-test:ostrio:[email protected]
[email protected]
local-test:ostrio:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
npm-mongo@3.0.11
npm-mongo@3.1.1
[email protected]
ostrio:[email protected].7
ostrio:[email protected].6
ostrio:[email protected].7
[email protected].1
ostrio:[email protected].8
ostrio:[email protected].7
ostrio:[email protected].8
[email protected].2
[email protected]
[email protected]
[email protected]
[email protected]
routepolicy@1.0.13
[email protected].1
routepolicy@1.1.0
[email protected].2
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
});
Expand Down Expand Up @@ -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*]
Expand Down Expand Up @@ -182,21 +183,21 @@ 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();
```

## 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:

Expand Down
13 changes: 6 additions & 7 deletions package.js
Original file line number Diff line number Diff line change
@@ -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:[email protected]', 'server');
api.use(['ecmascript', 'check', 'ostrio:[email protected]'], ['client', 'server']);
api.use('underscore', 'server');
api.use('ostrio:[email protected]', 'server');
api.use(['ecmascript', 'check', 'ostrio:[email protected]'], ['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'
});

0 comments on commit 127abdd

Please sign in to comment.