Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated README.md package.json for NPM

  • Loading branch information...
commit fa6f3deeb9d5efcb3542b435b4e214fb717750a5 1 parent 14e3cc9
@georgeOsdDev authored
Showing with 15 additions and 3 deletions.
  1. +14 −2 README.md
  2. +1 −1  package.json
View
16 README.md
@@ -7,10 +7,13 @@ Some debug utility for both server-side and client-side javascript.
```bash
npm install --save debug-util
```
+
and
+
```javascript
var debugUtil = require('debug-util');
```
+
### Client Side
```html
@@ -22,12 +25,15 @@ Client Side, `debugUtil` object is defined as `window.debugUtil`
## Usage
### getColorLogger(name,level,color)
+
```javascript
logger = debugUtil.getColorLogger("myLogger","info","cyan");
logger.log("message");
```
+
e.g.
this code will display like this
+
```javascript
defaultLogger = debugUtil.getColorLogger();
defaultLogger.log("This line is 'debug' level and color is 'default'");
@@ -37,18 +43,18 @@ defaultLogger.warn("This line is 'warn' level and color is 'yellow'");
defaultLogger.info("This line is 'info' level and color is 'cyan'");
defaultLogger.debug("This line is 'debug' level and color is 'default'");
defaultLogger.trace("This line is 'trace' level and color is 'white'");
-
//Set Name and Level
appLogger = debugUtil.getColorLogger("App","info");
appLogger.log("This line is 'info' level and color is 'default' and appender name is 'App'");
-
//Set Name, Level and Color
sysLogger = debugUtil.getColorLogger("Sys","warn","magenta");
sysLogger.log("This line is 'warn' level and color is 'magenta' and appender name is 'Sys'");
```
+
![Screen Shot](https://raw.github.com/georgeOsdDev/debugUtil/master/ScreenShot.png)
### loggingWrap(context,function)
+
```javascript
function sum(a,b){
return a+b;
@@ -56,21 +62,27 @@ function sum(a,b){
sum = debugUtil.loggingWrap(this,sum);
sum(1,2);
```
+
in your console
+
```
Start sum
arguments[0] = 1
arguments[1] = 2
result = [3]
```
+
### debugToScreen(String) *client side only
+
```javascript
debugUtil.debugToScreen("message");
```
+
message will append to `document.body` and will hide on click.
## License
+
Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)
<br/>Copyright &copy; 2012 [Takeharu.Oshida](http://georgeosddev.github.com)
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "debug-util",
- "version": "0.1.0",
+ "version": "0.1.1",
"description": "Some debug utility for both server-side and client-side javascript.",
"homepage": "https://github.com/georgeosddev/debugUtil",
"keywords": [
Please sign in to comment.
Something went wrong with that request. Please try again.