Skip to content

Commit

Permalink
implemented log method; release 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
int32at committed Nov 10, 2013
1 parent 3241396 commit d9d06ce
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 13 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ log.warn("this is a warning message");
```

The following log levels are supported:
- `log.log`: log message
- `log.info`: info message
- `log.debug`: debug message
- `log.warn`: warning message
Expand Down Expand Up @@ -164,6 +165,10 @@ If you do not find an appender that fits your needs you can simply write your ow
self.args = args;
},

log : function(text) {
alert(text);
},

info : function(text) {
alert(text);
},
Expand Down
2 changes: 0 additions & 2 deletions dist/log-0.1.1.min.js

This file was deleted.

20 changes: 20 additions & 0 deletions dist/log-0.1.1.js → dist/log-0.1.2.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
self.args = args;
},

log : function(text) {
alert(text);
},

info : function(text) {
alert(text);
},
Expand Down Expand Up @@ -46,6 +50,10 @@
self.args = args;
},

log : function(text) {
console.log(text);
},

info : function(text) {
console.info(text);
},
Expand Down Expand Up @@ -91,6 +99,10 @@
self.args = args;
},

log : function(text) {
send(text);
},

info : function(text) {
send(text);
},
Expand Down Expand Up @@ -149,6 +161,10 @@
});
},

log : function(text) {
toastr.info(text);
},

info : function(text) {
toastr.info(text);
},
Expand Down Expand Up @@ -294,6 +310,10 @@
self.currentAppender.init(args, callback);
},

log : function(text) {
self.currentAppender.log(formatText(text, "LOG", arguments));
},

info : function(text) {
self.currentAppender.info(formatText(text, "INFO", arguments));
},
Expand Down
2 changes: 2 additions & 0 deletions dist/log-0.1.2.min.js

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": "log",
"version": "0.1.1",
"version": "0.1.2",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.5",
Expand Down
4 changes: 2 additions & 2 deletions spec/objectSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ describe('log.js object tests', function() {
});

it('should be possible to use the log.appender object', function() {
expect(log).not.toBeUndefined();
expect(log.appender).not.toBeUndefined();
});

it('should be possible to use the log.common object', function() {
expect(log).not.toBeUndefined();
expect(log.common).not.toBeUndefined();
});
});
4 changes: 4 additions & 0 deletions src/appender/alertAppender.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
self.args = args;
},

log : function(text) {
alert(text);
},

info : function(text) {
alert(text);
},
Expand Down
4 changes: 4 additions & 0 deletions src/appender/consoleAppender.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
self.args = args;
},

log : function(text) {
console.log(text);
},

info : function(text) {
console.info(text);
},
Expand Down
4 changes: 4 additions & 0 deletions src/appender/serviceAppender.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
self.args = args;
},

log : function(text) {
send(text);
},

info : function(text) {
send(text);
},
Expand Down
4 changes: 4 additions & 0 deletions src/appender/toasterAppender.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
});
},

log : function(text) {
toastr.info(text);
},

info : function(text) {
toastr.info(text);
},
Expand Down
4 changes: 4 additions & 0 deletions src/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
self.currentAppender.init(args, callback);
},

log : function(text) {
self.currentAppender.log(formatText(text, "LOG", arguments));
},

info : function(text) {
self.currentAppender.info(formatText(text, "INFO", arguments));
},
Expand Down
12 changes: 4 additions & 8 deletions testpage.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<html>
<head>
<title>Test Page</title>
<script src="dist/log-0.1.1.js" type="text/javascript"></script>
<script src="dist/log-0.1.2.js" type="text/javascript"></script>
<script src="lib/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<script>
log.info("TEXT");
// var options = {
// url : "https://dev.int32.at/log.js/examples/serviceAppender/data.php"
// };

// log.init(log.appender.serviceAppender, options);
// log.info("this is a sample message");
// log.init(log.appender.toastrAppender, null, function() {
// log.info("this is a sample message");
// });
</script>
</body>
</html>

0 comments on commit d9d06ce

Please sign in to comment.