Code Monkey home page Code Monkey logo

seajs-log's Introduction

A Module Loader for the Web

Sea.js is a module loader for the web. It is designed to change the way that you organize JavaScript. With Sea.js, it is pleasure to build scalable web applications.

The official site: https://seajs.github.io/seajs/

Build Status

Questions?

If you have any questions, please feel free to ask through New Issue.

Reporting an Issue

Make sure the problem you're addressing is reproducible. Use http://jsbin.com/ or http://jsfiddle.net/ to provide a test page. Indicate what browsers the issue can be reproduced in. What version of Sea.js is the issue reproducible in. Is it reproducible after updating to the latest version?

License

Sea.js is available under the terms of the MIT License.

seajs-log's People

Contributors

afc163 avatar army8735 avatar lifesinger avatar lizzie avatar popomore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seajs-log's Issues

中文文档

加载 seajs-log 插件后,seajs 会拥有 log 方法。

seajs.log Function

苦逼的前端经常会在代码中加入类似下面这种代码:

if (typeof console === 'undefined') {
    console = { log: function() {}, warn: function() {}, ... }
}

为的是上线后,如果某个浏览器不支持 console ,代码不会抛错。

有了 Sea.js,我们再也不用这么去担心受怕了。直接通过 seajs.log 就可以搞定一切:

seajs.log('订单流程', 'group'); // 调用 console.group
seajs.log('a 的值是 ' + a.value); // 调用 console.log
seajs.log('发现错误 ' + msg, 'warn'); // 调用 console.warn
seajs.log('订单流程', 'groupEnd'); // 调用 console.groupEnd

上面是简单示例,只要是 console 支持的方法,都可以作为最后一个参数传进去。默认调用的是 console.log 方法。

注意console.log 信息默认不会显示,在 Sea.js 的 debug 为 true 时才显示。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.