本文整理汇总了TypeScript中ng2-logger.Log类的典型用法代码示例。如果您正苦于以下问题:TypeScript Log类的具体用法?TypeScript Log怎么用?TypeScript Log使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Log类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: hello
//#region @backend
console.log('heeloa')
import * as path from 'path';
import * as _ from "lodash";
import "reflect-metadata";
import { createConnection, useContainer } from 'typeorm';
//#endregion
import { init, ENDPOINT, GET, Response } from 'morphi';
import { Log, Level } from 'ng2-logger';
const log = Log.create('main application')
const log2 = Log.create('auth module')
const log3 = Log.create('books module')
const log4 = Log.create("/Users/test/Projects/testProject/index.ts")
export class User {
name: string;
id: number;
friend: User;
}
@ENDPOINT({ path: '/hello' })
export class UserController {
@GET('/')
hello(): Response<User> {
let user = new User();
return { send: user }
开发者ID:darekf77,项目名称:ng2-logger,代码行数:31,代码来源:index.ts
示例2: DebugLog
import { Log } from 'ng2-logger';
export const log = Log.create('<%= conf.appNameKC %>');
log.color = 'black';
export function DebugLog(target: Object, key: string, descriptor: TypedPropertyDescriptor<any>) {
return {
value: function(...args: any[]) {
const result = descriptor.value.apply(this, args);
log.data(`Call: ${target.constructor.name}.${key}`, { arguments: args });
return result;
}
};
}
开发者ID:garlictech,项目名称:generator-garlic-webapp,代码行数:14,代码来源:log.ts
示例3:
import * as _ from 'lodash';
import { describe } from 'mocha'
import { expect, use } from 'chai'
import { CLASS } from 'typescript-class-helpers';
// import { BrowserDB } from '../browser-db/browser-db';
import { Mapping } from '../mapping'
import { encode } from 'punycode';
import { Log } from 'ng2-logger';
const log = Log.create('mapping test')
// const instance = BrowserDB.instance;
describe('Mapping inheritance', () => {
// @CLASS.NAME('Coffee')
class Coffee {
}
// @CLASS.NAME('Project')
@Mapping.DefaultModelWithMapping<Project>(void 0, {
cup: 'Coffee',
projectInside: 'Project'
})
class Project {
cup: Coffee;
projectInside: Project;
location: string;
开发者ID:darekf77,项目名称:ng2-rest,代码行数:30,代码来源:mapping-inheritance.spec.ts
示例4: children
import * as _ from 'lodash';
import { describe } from 'mocha'
import { expect, use } from 'chai'
import { Log } from 'ng2-logger';
const log = Log.create('Circural test');
// import { BrowserDB } from '../browser-db/browser-db';
import { Mapping } from '../mapping'
import { CLASS } from 'typescript-class-helpers';
@CLASS.NAME('Project')
export class Project {
browser: {
name: string;
location: string;
children: Project[];
parent: Project;
}
get children() {
return this.browser && this.browser.children;
}
get parent() {
return this.browser && this.browser.parent;
}
开发者ID:darekf77,项目名称:ng2-rest,代码行数:29,代码来源:circural.spec.ts
注:本文中的ng2-logger.Log类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论