1. // console样式
    2. const __getStyle = bgColor => {
    3. return [
    4. `background:${bgColor} ; height: 18px;line-height: 18px; padding: 1px; border-radius: 3px 0 0 3px; color: #fff`,
    5. "background:#169fe6 ; height: 18px;line-height: 18px; padding: 1px; border-radius: 0 3px 3px 0; color: #fff"
    6. ];
    7. };
    8. const CONSOLE_INFO = "Info";
    9. const CONSOLE_WARN = "Warn";
    10. const CONSOLE_ERROR = "Error";
    11. const CONSOLE_STYLE = {
    12. [CONSOLE_INFO]: __getStyle("#333"),
    13. [CONSOLE_WARN]: __getStyle("#f90"),
    14. [CONSOLE_ERROR]: __getStyle("#f00")
    15. };
    16. const OUT_LOG = (msg, type) => {
    17. console.log(`%c GridManager ${type} %c ${msg} `, ...CONSOLE_STYLE[type]);
    18. };