angular-ru / angular-logger Goto Github PK
View Code? Open in Web Editor NEWMove: https://github.com/Angular-RU/angular-ru-sdk
Move: https://github.com/Angular-RU/angular-ru-sdk
console.time("answer time");
alert("Click to continue");
console.timeLog("answer time");
LoggerModule.forRoot({
format: ({ label, style }) => {
const date = new Date().toLocaleString('ru-RU').replace(',', '');
return [ `${date} ${label.toUpperCase()} `, style ];
}
})
Before
export class AppComponent implements OnInit {
constructor(private logger: LoggerService) {}
public ngOnInit(): void {
this.logger.debug('hello world');
}
}
After
export class AppComponent implements OnInit {
@Logger() private logger: LoggerService;
public ngOnInit(): void {
this.logger.debug('hello world');
}
}
Before
export class AppComponent implements OnInit {
constructor(private logger: LoggerService) {}
public ngOnInit(): void {
this.logger.trace('hello world');
this.logger.debug('hello world');
this.logger.log('hello world');
this.logger.warn('hello world');
this.logger.error('hello world');
}
}
After
export class AppComponent implements OnInit {
@Trace() private trace: LogFn;
@Debug() private debug: LogFn;
@Log() private log: LogFn;
@Warn() private warn: LogFn;
@Error() private error: LogFn;
public ngOnInit(): void {
this.trace('hello world');
this.debug('hello world');
this.log('hello world');
this.warn('hello world');
this.error('hello world');
}
}
Before
export class AppComponent implements OnInit {
constructor(private readonly logger: LoggerService) {}
public ngOnInit(): void {
this.logger.group(
'Show trace in opened group',
({ trace }: LoggerService): void => {
for (let i: number = 0; i < 20; i++) {
trace( 'trace is worked', i);
}
}
);
}
}
After
export class AppComponent implements OnInit {
@Trace() private trace: LogFn;
@Group('Show trace in opened group') public ngOnInit(): void {
for (let i: number = 0; i < 20; i++) {
this.trace('trace is worked', i);
}
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.