{"id":19345542,"url":"https://github.com/future-team/dev-pretty-log","last_synced_at":"2026-06-18T15:31:07.493Z","repository":{"id":58240262,"uuid":"53117877","full_name":"future-team/dev-pretty-log","owner":"future-team","description":"前端项目日志打印模块(适配线上和本地开发)","archived":false,"fork":false,"pushed_at":"2016-03-27T02:29:51.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T12:49:21.161Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/future-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-04T07:53:51.000Z","updated_at":"2016-03-18T02:04:00.000Z","dependencies_parsed_at":"2022-08-31T00:22:22.123Z","dependency_job_id":null,"html_url":"https://github.com/future-team/dev-pretty-log","commit_stats":null,"previous_names":["mtuan-f4/dev-pretty-log"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Fdev-pretty-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Fdev-pretty-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Fdev-pretty-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Fdev-pretty-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/future-team","download_url":"https://codeload.github.com/future-team/dev-pretty-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240280810,"owners_count":19776414,"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-11-10T04:06:56.273Z","updated_at":"2026-06-18T15:31:02.472Z","avatar_url":"https://github.com/future-team.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## dev-pretty-log(前端项目的本地及线上调试日志模块)\n\n#### 主要功能特点介绍\n\n-  封装alert和console\n-  对前端本地开发的日志添加样式，打印信息的形式更加直观\n-  自动检测线上环境，去除所有的打印信息及alert\n-  增加日志调试开关接口。重现开发日志，便于处理项目线上问题\n\n### 注意点\n\u003e 默认仅对localhost和127.0.0.1的url地址可见日志\n\n#### 安装\n\n- npm install dev-pretty-log --save-dev\n- git clone https://github.com/future-team/dev-pretty-log\n\n### 使用\n\u003ehtml:script标签引入\n\n```\n\t\u003cscript src=\"path to dev-pretty-log/dist/dev-pretty-log.min.js\"\u003e\u003c/script\u003e\n\t\u003cscript\u003e\n\t    devLog.open();//线上开启log功能,本地默认开启\n\t    devLog.log('hello world');\n\t    devLog.warn('it's a warning);\n\t    devLog.close();//关闭log功能\n\t\u003c/script\u003e\n\n```\n\u003eJS:ECMAScript6 语法\n\n``` javascript\n\n\timport devLog from 'dev-pretty-log'\n\tdevLog.alarm({a:1});//自动将对象转换成字符串,同时在窗口和控制台打印\n\tdevLog.log('hello','world');\n\tdevLog.debug('hello world');\n\tdevLog.warn('warning');\n\tdevLog.error('warning');\n\tdevLog.dir('warning');\n\tdevLog.open()//手动开启日志(默认本地开发不需手动开启)\n\tdevLog.close()//手动关闭日志\n\t\n```\n\n### 命令\n\n``` bash\t\n\n\tnpm run build\t#打包\t\n\tnpm run demo \t#查看demo方式 cd examples \u0026\u0026 open index.html\n\t\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuture-team%2Fdev-pretty-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuture-team%2Fdev-pretty-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuture-team%2Fdev-pretty-log/lists"}