├── .editorconfig ├── .gitattributes ├── .gitignore ├── .jshintrc ├── .npmignore ├── Gruntfile.js ├── LICENSE ├── README.md ├── bower.json ├── consolelog.detailprint.js ├── consolelog.detailprint.min.js ├── consolelog.js ├── consolelog.min.js └── package.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | end_of_line = lf 8 | charset = UTF-8 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | indent_style = space 12 | indent_size = 4 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.sublime-* 2 | test 3 | node_modules 4 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "curly": true, 3 | "eqeqeq": true, 4 | "immed": true, 5 | "latedef": true, 6 | "newcap": true, 7 | "noarg": true, 8 | // "sub": true, 9 | "undef": true, 10 | "browser": true, 11 | "globals": { 12 | "console": true, 13 | "log": true, 14 | "module": true 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | *.sublime-* 2 | node_modules 3 | .gitattributes 4 | .jshintrc 5 | test 6 | bower.json 7 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | require('load-grunt-tasks')(grunt); 3 | 4 | grunt.initConfig({ 5 | pkg: grunt.file.readJSON('package.json'), 6 | uglify: { 7 | options: { 8 | preserveComments: 'some', 9 | banner: '/*! @description <%= pkg.description %>\n' + 10 | ' * @version <%= pkg.version %>\n' + 11 | ' * @date <%= grunt.template.today("yyyy-mm-dd") %>\n' + 12 | ' * @copyright <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' + 13 | ' * <%= pkg.homepage %>\n' + 14 | ' */\n' 15 | }, 16 | build: { 17 | src: '<%= pkg.name %>.js', 18 | dest: '<%= pkg.name %>.min.js' 19 | } 20 | }, 21 | jshint: { 22 | options: { 23 | jshintrc: '.jshintrc' 24 | }, 25 | files: ['consolelog.js', 'consolelog.detailprint.js'] 26 | }, 27 | watch: { 28 | options: { 29 | livereload: true, 30 | interrupt: true 31 | }, 32 | scripts: { 33 | files: ['consolelog.js', 'consolelog.detailprint.js', 'demo/demo.js'], 34 | tasks: ['jshint'], 35 | options: { 36 | spawn: false, 37 | } 38 | }, 39 | styles: { 40 | files: ['**/*.less'], 41 | tasks: ['less', 'csslint'], 42 | options: { 43 | spawn: false, 44 | } 45 | } 46 | } 47 | }); 48 | 49 | // Default task (JS only) 50 | grunt.registerTask('default', ['jshint', 'uglify']); 51 | 52 | // Development 53 | grunt.registerTask('dev', ['default', 'watch']); 54 | }; 55 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Craig Patik 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any 4 | purpose with or without fee is hereby granted, provided that the above 5 | copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Console.log wrapper 2 | 3 | *Safe, clear console logging for every browser* 4 | 5 | Log to the console — even legacy browsers without a console. Just pass any data to `log()` and you'll see it printed clearly and well-structured in the console. 6 | 7 | If the browser doesn't have a console, Firebug Lite will load. You can pass any variable type: strings, objects, arrays, functions, etc. 8 | 9 | **Demo: [patik.github.io/console.log-wrapper](http://patik.github.io/console.log-wrapper/)** 10 | 11 | ## Installation 12 | 13 | **npm**: `npm install consolelog` 14 | 15 | **Bower**: `bower install consolelog` 16 | 17 | Or just download [consolelog.js](https://github.com/patik/console.log-wrapper/blob/master/consolelog.js) and reference it in your page with a `