MCPcopy Index your code
hub / github.com/css/csso / createDefaultLogger

Function createDefaultLogger

lib/index.js:15–39  ·  view source on GitHub ↗
(level)

Source from the content-addressed store, hash-verified

13}
14
15function createDefaultLogger(level) {
16 let lastDebug;
17
18 return function logger(title, ast) {
19 let line = title;
20
21 if (ast) {
22 line = `[${((Date.now() - lastDebug) / 1000).toFixed(3)}s] ${line}`;
23 }
24
25 if (level > 1 && ast) {
26 let css = generate(ast);
27
28 // when level 2, limit css to 256 symbols
29 if (level === 2 && css.length > 256) {
30 css = css.substr(0, 256) + '...';
31 }
32
33 line += `\n ${css}\n`;
34 }
35
36 console.error(line);
37 lastDebug = Date.now();
38 };
39}
40
41function buildCompressOptions(options) {
42 options = { ...options };

Callers 1

buildCompressOptionsFunction · 0.85

Calls 1

generateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…