Skip to content

Commit

Permalink
2.0.0-beta.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Download committed Mar 11, 2020
1 parent fc5a47e commit 423ce1c
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 24 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ulog <sub><sup>v2.0.0-beta.6</sup></sub>
# ulog <sub><sup>v2.0.0-beta.7</sup></sub>
### Microscopically small universal logging library

[![npm](https://img.shields.io/npm/v/ulog.svg)](https://npmjs.com/package/ulog)
Expand Down Expand Up @@ -65,8 +65,8 @@ You should also be able to use e.g. Yarn etc.
If you want the file for the browser to include in your project yourself,
you can download it from here.

* [ulog.umd.js](https://cdn.rawgit.com/download/ulog/2.0.0-beta.6/ulog.umd.js) (~3kB, source)
* [ulog.min.js](https://cdn.rawgit.com/download/ulog/2.0.0-beta.6/ulog.min.js) (~2kB, minified)
* [ulog.umd.js](https://cdn.rawgit.com/download/ulog/2.0.0-beta.7/ulog.umd.js) (~3kB, source)
* [ulog.min.js](https://cdn.rawgit.com/download/ulog/2.0.0-beta.7/ulog.min.js) (~2kB, minified)


## Include in your app
Expand Down Expand Up @@ -94,7 +94,7 @@ const log = ulog('my-module')
If you want, you can import `ulog` with a script tag:

```html
<script src="https://cdn.rawgit.com/download/ulog/2.0.0-beta.6/ulog.min.js"></script>
<script src="https://cdn.rawgit.com/download/ulog/2.0.0-beta.7/ulog.min.js"></script>
<script src="myscript.js"></script>
```
*myscript.js*
Expand Down
43 changes: 31 additions & 12 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ulog",
"version": "2.0.0-beta.6",
"version": "2.0.0-beta.7",
"description": "Microscopically small universal logging library",
"main": "node.js",
"unpkg": "ulog.min.js",
Expand Down
16 changes: 13 additions & 3 deletions ulog.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,31 @@ log.enabled = function(s) {
if (dbgMods[i].test(s)) {return true}
}

log.invoke = function(name,args) {
var method = args.length > 1 && names[args[0]] ? args.shift() : 'debug'
for (var i=0; i<log.formats.length; i++) {
log.formats[i](mods[name],method,args)
}
mods[name][method].apply(mods[name], args)
}

log.disable = log.enable.bind(log, '')

var LVL = {ERROR:1, WARN:2, INFO:3, LOG:4, DEBUG:5, TRACE:6},
names = {error:1, warn:2, info:3, log:4, verbose:4, debug:5, trace:6, silly:6, dir:0, table:0, time:0, timeEnd:0, assert:0},
mods = {}, dbgMods = [], skipMods = []


function create(n,r) {
eval("r = {'" + n + "': function() {var a = [].slice.call(arguments), m = a.length > 1 && names[a[0]] ? a.shift() : 'debug'; for (var i=0; i<log.formats.length; i++) log.formats[i](mods[n],m,a); return mods[n][m].apply(mods[n], a)}}[n]")
return r.name ? r : Object.defineProperty(r, 'name', {get:function(){return n}})
r = (new Function('n', 'log', "return {'" + n + "':function(){log.invoke(n,[].slice.call(arguments))}}[n]"))(n, log)
try {Object.defineProperty(r, 'name', {get:function(){return n}})} catch(e) {}
return r
}

function extend(o,p,l) {
if (o.log) return
o.NONE = 0
o.ulog = {version:'2.0.0-beta.6'}
o.ulog = {version:'2.0.0-beta.7'}
for (var key in LVL) {o[key] = LVL[key]}
Object.defineProperty(o, 'level', {
get: function(){return l !== undefined ? l : p && p.level},
Expand Down
2 changes: 1 addition & 1 deletion ulog.min.js

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

16 changes: 13 additions & 3 deletions ulog.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,31 @@ log.enabled = function(s) {
if (dbgMods[i].test(s)) {return true}
}

log.invoke = function(name,args) {
var method = args.length > 1 && names[args[0]] ? args.shift() : 'debug'
for (var i=0; i<log.formats.length; i++) {
log.formats[i](mods[name],method,args)
}
mods[name][method].apply(mods[name], args)
}

log.disable = log.enable.bind(log, '')

var LVL = {ERROR:1, WARN:2, INFO:3, LOG:4, DEBUG:5, TRACE:6},
names = {error:1, warn:2, info:3, log:4, verbose:4, debug:5, trace:6, silly:6, dir:0, table:0, time:0, timeEnd:0, assert:0},
mods = {}, dbgMods = [], skipMods = []


function create(n,r) {
eval("r = {'" + n + "': function() {var a = [].slice.call(arguments), m = a.length > 1 && names[a[0]] ? a.shift() : 'debug'; for (var i=0; i<log.formats.length; i++) log.formats[i](mods[n],m,a); return mods[n][m].apply(mods[n], a)}}[n]")
return r.name ? r : Object.defineProperty(r, 'name', {get:function(){return n}})
r = (new Function('n', 'log', "return {'" + n + "':function(){log.invoke(n,[].slice.call(arguments))}}[n]"))(n, log)
try {Object.defineProperty(r, 'name', {get:function(){return n}})} catch(e) {}
return r
}

function extend(o,p,l) {
if (o.log) return
o.NONE = 0
o.ulog = {version:'2.0.0-beta.6'}
o.ulog = {version:'2.0.0-beta.7'}
for (var key in LVL) {o[key] = LVL[key]}
Object.defineProperty(o, 'level', {
get: function(){return l !== undefined ? l : p && p.level},
Expand Down

0 comments on commit 423ce1c

Please sign in to comment.