From 111becd569668cd6c62e23a825e4b7674f4eb09b Mon Sep 17 00:00:00 2001 From: "Dmitriy A. Golev" Date: Fri, 29 May 2015 01:22:17 +0300 Subject: [PATCH] v0.0.6 - Fix issue [#2](https://github.com/VeliovGroup/Meteor-logger-file/issues/2) - Remove colon from file names, to avoid Windows compilation issues - License update --- .versions | 2 +- LICENSE | 44 ++++++++++++++++----------- ostrio:logger.coffee => logger.coffee | 22 +++++++++----- package.js | 4 +-- 4 files changed, 44 insertions(+), 28 deletions(-) rename ostrio:logger.coffee => logger.coffee (91%) diff --git a/.versions b/.versions index fdf9311..35bcfd2 100644 --- a/.versions +++ b/.versions @@ -1,6 +1,6 @@ coffeescript@1.0.6 meteor@1.1.6 -ostrio:logger@0.0.5 +ostrio:logger@0.0.6 reactive-var@1.0.5 tracker@1.0.7 underscore@1.0.3 diff --git a/LICENSE b/LICENSE index 2fe4a74..99d4a03 100755 --- a/LICENSE +++ b/LICENSE @@ -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. \ No newline at end of file diff --git a/ostrio:logger.coffee b/logger.coffee similarity index 91% rename from ostrio:logger.coffee rename to logger.coffee index 3cfe79b..f0fdecf 100755 --- a/ostrio:logger.coffee +++ b/logger.coffee @@ -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 @@ -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 diff --git a/package.js b/package.js index 36031de..ba4c390 100755 --- a/package.js +++ b/package.js @@ -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' @@ -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']); });