-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Compatibility with `[email protected]` - Dependencies update - Exact code splitting between Server and Client, fix #9 , thanks to @mddarko
- Loading branch information
1 parent
eee0592
commit 9da7d60
Showing
6 changed files
with
118 additions
and
75 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Logger } from 'meteor/ostrio:logger'; | ||
import { check, Match } from 'meteor/check'; | ||
const NOOP = () => {}; | ||
|
||
/* | ||
* @class LoggerFile | ||
* @summary File (FS) adapter for ostrio:logger (Logger) | ||
*/ | ||
class LoggerFile { | ||
constructor(logger, options = {}) { | ||
check(logger, Match.OneOf(Logger, Object)); | ||
check(options, Match.Optional(Object)); | ||
|
||
this.logger = logger; | ||
this.options = options; | ||
this.logger.add('File', NOOP, NOOP, false, false); | ||
} | ||
|
||
enable(rule = {}) { | ||
check(rule, { | ||
enable: Match.Optional(Boolean), | ||
client: Match.Optional(Boolean), | ||
server: Match.Optional(Boolean), | ||
filter: Match.Optional([String]) | ||
}); | ||
|
||
if (rule.enable == null) { | ||
rule.enable = true; | ||
} | ||
if (rule.client == null) { | ||
rule.client = true; | ||
} | ||
if (rule.server == null) { | ||
rule.server = true; | ||
} | ||
|
||
this.logger.rule('File', rule); | ||
return this; | ||
} | ||
} | ||
|
||
export { LoggerFile }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package.describe({ | ||
name: 'ostrio:loggerfile', | ||
version: '2.0.0', | ||
version: '2.0.1', | ||
summary: 'Logging: Store application\'s logs into file (Server & Client support)', | ||
git: 'https://github.com/VeliovGroup/Meteor-logger-file', | ||
documentation: 'README.md' | ||
|
@@ -9,16 +9,18 @@ Package.describe({ | |
Package.onUse(function(api) { | ||
api.versionsFrom('1.4'); | ||
api.use('ostrio:[email protected]', 'server'); | ||
api.use(['ecmascript', 'check', 'underscore', 'ostrio:[email protected]'], ['client', 'server']); | ||
api.mainModule('loggerfile.js', ['client', 'server']); | ||
api.use(['ecmascript', 'check', 'ostrio:[email protected]'], ['client', 'server']); | ||
api.use('underscore', 'server'); | ||
api.mainModule('client.js', 'client'); | ||
api.mainModule('server.js', 'server'); | ||
}); | ||
|
||
Package.onTest(function(api) { | ||
api.use('tinytest'); | ||
api.use(['ecmascript', 'underscore', 'ostrio:[email protected].2', 'ostrio:[email protected].0']); | ||
api.use(['ecmascript', 'underscore', 'ostrio:[email protected].3', 'ostrio:[email protected].1']); | ||
api.addFiles('loggerfile-tests.js'); | ||
}); | ||
|
||
Npm.depends({ | ||
'fs-extra': '3.0.1' | ||
'fs-extra': '4.0.1' | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters