{"id":13447089,"url":"https://github.com/patik/console.log-wrapper","last_synced_at":"2025-04-09T05:09:54.080Z","repository":{"id":56371568,"uuid":"1602043","full_name":"patik/console.log-wrapper","owner":"patik","description":"Clear console logging for every browser","archived":false,"fork":false,"pushed_at":"2022-05-08T15:21:53.000Z","size":256,"stargazers_count":406,"open_issues_count":0,"forks_count":53,"subscribers_count":29,"default_branch":"main","last_synced_at":"2024-05-29T03:49:43.185Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://patik.github.io/console.log-wrapper/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-04-12T01:34:53.000Z","updated_at":"2024-02-14T05:46:19.000Z","dependencies_parsed_at":"2022-08-15T17:31:06.366Z","dependency_job_id":null,"html_url":"https://github.com/patik/console.log-wrapper","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patik%2Fconsole.log-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patik%2Fconsole.log-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patik%2Fconsole.log-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patik%2Fconsole.log-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patik","download_url":"https://codeload.github.com/patik/console.log-wrapper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980837,"owners_count":21027808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T05:01:07.841Z","updated_at":"2025-04-09T05:09:54.058Z","avatar_url":"https://github.com/patik.png","language":"JavaScript","readme":"# Console.log wrapper\n\n*Safe, clear console logging for every browser*\n\nLog to the console \u0026mdash; 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.\n\nIf the browser doesn't have a console, Firebug Lite will load. You can pass any variable type: strings, objects, arrays, functions, etc.\n\n**Demo: [patik.github.io/console.log-wrapper](http://patik.github.io/console.log-wrapper/)**\n\n## Installation\n\n**npm**: `npm install consolelog`\n\n**Bower**: `bower install consolelog`\n\nOr just download [consolelog.js](https://github.com/patik/console.log-wrapper/blob/master/consolelog.js) and reference it in your page with a `\u003cscript\u003e` tag.\n\n## Usage\n\nUse `log()` wherever you want to write to the console.\n\n### AMD with RequireJS\n\nConsolelog.js is AMD-compliant and supports Common JS:\n\n```js\nrequire(['consolelog'], function(log) {\n    log('It works!');\n});\n```\n\n### Settings\n\nYou can change some optional preferences by passing an object to `log.settings()`. The defaults are shown below.\n\n```js\nlog.settings({\n    lineNumber: true,\n    group: {\n        label: 'Log:',\n        collapsed: false\n    }\n});\n```\n\n- `lineNumber` (Boolean)\n    + Whether to append the actual line number to each log. Not supported by all browsers.\n- `group` (Boolean or object)\n    + Groups the arguments for each log together\n    + `collapsed: true` will collapse each group (in browsers that support collapsing)\n    + `label: \"some string\"` sets the label or name for the groups\n    + Simply setting `group: true` is a shorthand way of selecting the defaults\n\n## Detail Print\n\nThis is an optional plugin to provide help information about the data that is being logged, especially in IE and older browsers. Just include [consolelog.detailprint.js](https://github.com/patik/console.log-wrapper/blob/master/consolelog.detailprint.js) along with [consolelog.js](https://github.com/patik/console.log-wrapper/blob/master/consolelog.js).\n\nFirebug, WebKit's Developer Tools, and Opera's Dragonfly print useful, interactive items to the console. For example:\n\n````js\nconsole.log(\n    \"Here's a string\",\n     3.14,\n     {\"alpha\": 5, \"bravo\": false},\n     document.getElementById('charlie'),\n     new Date()\n);\n````\n\nResults in:\n\n![Firebug running in Firefox](https://raw.github.com/patik/console.log-wrapper/gh-pages/demo/firebug.png)\n\nSome browsers that have a primitive console \u0026mdash; one that does not expand arrays, does not link DOM elements to the source code, only prints objects as `[object Object]` rather than listing their properties, etc.\n\n![IE8 without Detail Print](https://raw.github.com/patik/console.log-wrapper/gh-pages/demo/ie8-without-detail-print.png)\n\nSome cannot accept multiple arguments to a single `console.log` call. This includes IE 7/8/9/10, iOS 5 and older, and Opera 11 and older, among others.\n\nUsing the `detailPrint` companion plugin, special objects are presented in a more readable manner.\n\n![IE8 with Detail Print](https://raw.github.com/patik/console.log-wrapper/gh-pages/demo/ie8-with-detail-print.png)\n\n## Demo\n\n[patik.github.io/console.log-wrapper](http://patik.github.io/console.log-wrapper/)\n\n## Documentation\n\n[patik.com/blog/complete-cross-browser-console-log](http://patik.com/blog/complete-cross-browser-console-log)\n\n## License\n\nConsole.log-wrapper is released under [the ISC license](LICENSE).\n","funding_links":[],"categories":["JavaScript","Log","Log [🔝](#readme)","日志"],"sub_categories":["Runner","运行器","运行器e2e测试"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatik%2Fconsole.log-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatik%2Fconsole.log-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatik%2Fconsole.log-wrapper/lists"}