Skip to content

Commit

Permalink
v0.0.6
Browse files Browse the repository at this point in the history
 - Fix issue
[#2](veliovgroup/Meteor-logger-file#2)
 - Remove colon from file names, to avoid Windows compilation issues
 - License update
  • Loading branch information
dr-dimitru committed May 28, 2015
1 parent 5df735e commit 111becd
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .versions
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[email protected]
[email protected]
ostrio:[email protected].5
ostrio:[email protected].6
[email protected]
[email protected]
[email protected]
44 changes: 27 additions & 17 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
The MIT License (MIT)
Copyright (c) 2015, dr.dimitru (Also known as: ostr.io, Dmitriy Aristarkhovich, Dmitry A. and Veliov Group LTD.)
All rights reserved.

Copyright (c) 2015 Veliov Group Inc., ostr.io, Dmitriy Aristarkhovich, Dmitry A., drdimitru, dr-dimitru, dr.dimitru
Redistribution and use in source and binary forms,
with or without modification, are permitted provided
that the following conditions are met:

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
1. Redistributions of source code must retain the
above copyright notice, this list of conditions
and the following disclaimer.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
2. Redistributions in binary form must reproduce the
above copyright notice, this list of conditions and
the following disclaimer in the documentation and/or
other materials provided with the distribution.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3. Neither the name of the copyright holder nor the
names of its contributors may be used to endorse or
promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 changes: 14 additions & 8 deletions ostrio:logger.coffee → logger.coffee
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
###
@description Add 'ostrioLoggerUserId' reactiveVar value, to use in client when Meteor.userId() or this.userId isn't available
@description Add `userId` reactiveVar value, to use in client when Meteor.userId() or this.userId isn't available
###
if Meteor.isClient
ostrioLoggerUserId = new ReactiveVar ''
Tracker.autorun ->
ostrioLoggerUserId.set Meteor.userId()
if Package['accounts-base']
userId = new ReactiveVar ''
Tracker.autorun ->
userId.set Meteor.userId()
else
userId = new ReactiveVar null

###
@class
Expand Down Expand Up @@ -32,11 +35,14 @@ class Logger
logit: (level, message, data, userId) ->
for i, em of Logger::_emitters
if Logger::_rules[em.name] and Logger::_rules[em.name].allow.indexOf('*') isnt -1 or Logger::_rules[em.name] and Logger::_rules[em.name].allow.indexOf(level) isnt -1

if typeof userId == "undefined" or !userId
userId = this.userId

if Package['accounts-base']
if typeof userId == "undefined" or !userId
userId = this.userId

userId = if Meteor.isClient then ostrioLoggerUserId.get() else userId
userId = if Meteor.isClient then userId.get() else userId
else
userId = null

if Meteor.isClient and em.denyClient is true
Meteor.call em.method, level, message, data, userId
Expand Down
4 changes: 2 additions & 2 deletions package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'ostrio:logger',
version: '0.0.5',
version: '0.0.6',
summary: 'Meteor isomorphic logger driver',
git: 'https://github.com/VeliovGroup/Meteor-logger',
documentation: 'README.md'
Expand All @@ -10,5 +10,5 @@ Package.onUse(function(api) {
api.versionsFrom('1.0');
api.use('coffeescript', ['client', 'server']);
api.use(['reactive-var', 'tracker'], 'client');
api.addFiles('ostrio:logger.coffee', ['client', 'server']);
api.addFiles('logger.coffee', ['client', 'server']);
});

0 comments on commit 111becd

Please sign in to comment.