UNPKG

@lsk4/log

Version:

Yet another logger whitch combines the best features of debug, bunyan, logfmt/logrus, morgan/winston

7 lines (5 loc) 1.05 kB
import { colorize } from '@lsk4/colors'; var s=Object.defineProperty;var t=(o,e)=>s(o,"name",{value:e,configurable:!0});var b={fatal:["bgRed"],error:["bold","bgRed"],warn:["bgYellow"],debug:["bold","cyan"],info:["bold","green"],trace:["gray"],log:["bgWhite"]},g={fatal:["bold","red"],error:["red"],warn:["yellow"],debug:["cyan"],info:["green"],trace:["gray"],log:["bgWhite"]},n=[["red"],["green"],["yellow"],["blue"],["magenta"],["cyan"],["bold","red"],["bold","green"],["bold","yellow"],["bold","blue"],["bold","magenta"],["bold","cyan"]];var h=t(o=>typeof o=="number"?o:Math.abs(String(o).split("").reduce((e,r)=>{let a=(e<<5)-e+r.charCodeAt(0);return a&a},0)-48),"hashCode"),i=h;function L(o,e){let r=n[i(e||"")%n.length]||[];return colorize(o,r)}t(L,"themeizeRandom");function R(o,e){let r=e?b[e]:[];return colorize(o,r)}t(R,"themeize");function W(o,e){let r=e?g[e]:[];return colorize(o,r)}t(W,"themeizeLight"); export { R as themeize, W as themeizeLight, L as themeizeRandom }; //# sourceMappingURL=out.js.map //# sourceMappingURL=themeize.js.map