# Luna Console Console for logging, similar to the one in chrome DevTools. All these methods can be used in the same way as window.console object. log, error, info, warn, dir, time/timeLog/timeEnd, clear, count/countReset, assert, table, group/groupCollapsed/groupEnd ## Demo https://luna.liriliri.io/?path=/story/console ## Install Add the following script and style to your page. ```html ``` You can also get it on npm. ```bash npm install luna-console luna-dom-viewer luna-data-grid luna-object-viewer --save ``` ```javascript import 'luna-object-viewer/luna-object-viewer.css' import 'luna-data-grid/luna-data-grid.css' import 'luna-dom-viewer/luna-dom-viewer.css' import 'luna-console/luna-console.css' import LunaConsole from 'luna-console' ``` ## Usage ```javascript const container = document.getElementById('container') const console = new LunaConsole(container) console.log('luna') ``` ## Configuration * accessGetter(boolean): Access getter value. * asyncRender(boolean): Asynchronous rendering. * filter(string | RegExp | AnyFn): Log filter. * lazyEvaluation(boolean): Lazy evaluation for objects. * level(string | string[]): Log level, verbose, info, warning and error. * maxNum(number): Max log number, zero means infinite. * showHeader(boolean): Show time and from. * unenumerable(boolean): Show unenumerable properties. ## Api ### evaluate(code: string): void Evaluate JavaScript. ### html(args: any): void Log out html content.