Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 3 additions & 43 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,68 +1,28 @@
# IDEA
.idea
*.iml

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
.rpt2_cache

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
client/node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# Custom for github
lib/
dist/
bundles/
js/
54 changes: 33 additions & 21 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
.idea/
.nyc_output/
# IDEA
.idea
*.iml

.editorconfig
gulpfile.js
tsconfig.json
tslint.json
typings.json
typings
# Logs
logs
*.log
npm-debug.log*
package-lock.json
.rpt2_cache

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# Output of 'npm pack'
*.tgz

# Custom for npm
.github/
demo/
src/
*.log
*.tgz
*.yml
*.iml
*.opts
*.sh

# directories
node_modules/
coverage/
helpers/
test/
doc/
dist/
src/
demo/

# others
index.html
CHANGELOG.md
# project files
index.ts
rollup.config.js
tsconfig.json
tslint.json
.editorconfig
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 Jordan Gensler

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
76 changes: 0 additions & 76 deletions demo/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,76 +0,0 @@
<div class="ext-box" id="app" [class.load]="loaded">

<div class="int-box">

<div class="container">
<div class="row">
<div class="col-12">
<h3 class="center m-bottom">Simple logger for javascript</h3>
<p class="center">
In order to see examples, you need to open the browser console or press F12. <br>
You can also open a demo in REPL:
<a href="https://stackblitz.com/github/splincodewd/client-logger/tree/demo" target="_blank">stackblitz</a> or
<a href="https://codesandbox.io/s/github/splincodewd/client-logger/tree/master/demo" target="_blank">codesandbox</a>
</p>
</div>
</div>

<div id="console-activate" class="row example" [class.no-display]="!devToolsIsOpen">
<div class="col-3">
<button class="center-block" (click)="LoggerExamplesTemplate.showExample1()">Show me (example 1)</button>
<h5 class="center m-bottom">Basic method <br> (trace, debug, info, ..)</h5>
</div>
<div class="col-3">
<button class="center-block" (click)="LoggerExamplesTemplate.showExample2()">Show me (example 2)</button>
<h5 class="center m-bottom">Example groups <br> (closed, opened)</h5>
</div>
<div class="col-3">
<button class="center-block" (click)="LoggerExamplesTemplate.showExample3()">Show me (example 3)</button>
<h5 class="center m-bottom">Nested groups <br> (deep)</h5>
</div>
<div class="col-3">
<button class="center-block" (click)="LoggerExamplesTemplate.showExample4()">Show me (example 4)</button>
<h5 class="center m-bottom">Show only warnings <br> and error</h5>
</div>
<div class="col-3">
<button class="center-block" (click)="LoggerExamplesTemplate.showExample5()">Show me (example 5)</button>
<h5 class="center m-bottom">Custom css styles <br> for line</h5>
</div>
<div class="col-3">
<button class="center-block" (click)="LoggerExamplesTemplate.showExample6()">Show me (example 6)</button>
<h5 class="center m-bottom">Pretty json <br> (output)</h5>
</div>
<div class="col-3">
<button class="center-block" (click)="LoggerExamplesTemplate.showExample7()">Show me (example 7)</button>
<h5 class="center m-bottom">Level groups <br> (trace, debug, info, ..)</h5>
</div>
<div class="col-3">
<button class="center-block" (click)="LoggerExamplesTemplate.showExample8()">Show me (example 8)</button>
<h5 class="center m-bottom">Copy to clipboard <br> (string text)</h5>
</div>
<div class="col-3">
<button class="center-block" (click)="LoggerExamplesTemplate.showExample9()">Show me (example 9)</button>
<h5 class="center m-bottom">Global css <br> (css global style)</h5>
</div>
<div class="col-3">
<button class="center-block" (click)="LoggerExamplesTemplate.showExample10()">Show me (example 10)</button>
<h5 class="center m-bottom">Css classes<br> (set in console)</h5>
</div>
<div class="col-3">
<button class="center-block" (click)="LoggerExamplesTemplate.showExampleEnd()">Show me (example settings)</button>
<h5 class="center m-bottom">Full configuration <br> (change labels, colors)</h5>
</div>
</div>

</div>

<div id="console-dis-activate" class="row example" [class.no-display]="devToolsIsOpen">
<div class="col-12">
<h4 class="center m-bottom">You need open console</h4>
</div>
</div>

</div>


</div>
27 changes: 0 additions & 27 deletions demo/src/app/app.component.spec.ts

This file was deleted.

4 changes: 1 addition & 3 deletions demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import * as devtools from 'devtools-detect';
import { Examples } from './examples/examples.class';
import { environment } from '../environments/environment';
import { environment } from '@env/environment';

@Component({
selector: 'app-root',
Expand All @@ -13,7 +12,6 @@ export class AppComponent implements OnInit {

public loaded: boolean;
public devToolsIsOpen: boolean = environment.stackblitz || devtools.open;
public LoggerExamplesTemplate = Examples;

public ngOnInit() {
this.loaded = true;
Expand Down
11 changes: 6 additions & 5 deletions demo/src/app/examples/examples.class.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MyConsole } from './share/my-console';
import { greatBigJSON } from './share/entity';
import { MyConsole } from '@app/my-console';
import { greatBigJSON } from '@app/entity';
import { LoggerBootstrapInit } from './share';

export class Examples {
Expand Down Expand Up @@ -236,9 +236,10 @@ export class Examples {

const JsonValue = { a: 1, b: [1, 2, 3] };

logger.group('copy JSON', ({ log, stringify, clipboard }) => {
logger.group('copy JSON', ({ log, stringify, clipboard, table }) => {
log(...stringify(clipboard.copy(JsonValue)));
log('The object you have on the clipboard ...', clipboard.paste());
log('The object you have on the clipboard ... \n', 'copy.paste() ->');
table(clipboard.paste());
});

}
Expand Down Expand Up @@ -280,7 +281,7 @@ export class Examples {
'code-sandbox': `
color: #666;
background: #f4f4f4;
border-left: 3px solid #f36d33;
border-left: 3px solid #f36d33;
font-family: monospace;
font-size: 15px;
`
Expand Down
2 changes: 1 addition & 1 deletion demo/src/app/examples/share/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { environment } from '../../../environments/environment';
import { environment } from '@env/environment';
import { ClientLogger, FormatLine, LoggerLevel } from '@splincode/client-logger';

function windowLoggerInit(LoggerAPI) {
Expand Down
4 changes: 2 additions & 2 deletions demo/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { AppModule } from '@app/app.module';
import { environment } from '@env/environment';

if (environment.production) {
enableProdMode();
Expand Down
7 changes: 6 additions & 1 deletion demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compileOnSave": false,
"compilerOptions": {
"rootDir": ".",
"baseUrl": "src",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
Expand All @@ -15,6 +16,10 @@
"lib": [
"es2017",
"dom"
]
],
"paths": {
"@app/*": ["app/*", "app/examples/*", "app/examples/share/*"],
"@env/*": ["environments/*"]
}
}
}
9 changes: 5 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './src/logger.config';
export * from './src/logger.impl';
export * from './src/logger.class';
export { LineStyle } from './src/plugins/css-parser/css-parser.impl';
export { FormatLine } from './src/plugins/css-parser/css-parser.impl';
export * from './src/logger.impl';
export * from './src/logger.config';
export * from './src/plugins/plugins.class';
export * from './src/plugins/plugins.impl';
export * from './src/plugins/plugins.config';
Loading