logging
This commit is contained in:
Родитель
efd237cfe4
Коммит
555f90b9da
2
cli.ts
2
cli.ts
|
@ -2,7 +2,7 @@
|
|||
|
||||
import yargs = require('yargs')
|
||||
import os = require('os')
|
||||
import log = require('./lib/util/logging')
|
||||
import { log } from './lib/util/logging'
|
||||
|
||||
let defaultLogDir = log.directory
|
||||
let logFilepath = log.filepath
|
||||
|
|
2
index.ts
2
index.ts
|
@ -10,7 +10,7 @@ export let validateSpec = validate.validateSpec;
|
|||
export let validateCompositeSpec = validate.validateCompositeSpec;
|
||||
export let validateExamples = validate.validateExamples;
|
||||
export let validateExamplesInCompositeSpec = validate.validateExamplesInCompositeSpec;
|
||||
export let log = require('./lib/util/logging');
|
||||
export { log } from './lib/util/logging'
|
||||
export let executePromisesSequentially = utils.executePromisesSequentially;
|
||||
export let resolveSpec = validate.resolveSpec;
|
||||
export let resolveCompositeSpec = validate.resolveCompositeSpec;
|
||||
|
|
|
@ -8,7 +8,7 @@ import linq = require('linq')
|
|||
import jsonPath = require('jsonpath')
|
||||
import yaml = require("js-yaml")
|
||||
import utils = require("../util/utils")
|
||||
import log = require('../util/logging')
|
||||
import { log } from '../util/logging'
|
||||
import SpecValidator = require('../validators/specValidator')
|
||||
import extensionBase = require('@microsoft.azure/autorest-extension-base')
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
import util = require('util')
|
||||
import log = require('../util/logging')
|
||||
import { log } from '../util/logging'
|
||||
import validate = require('../validate')
|
||||
|
||||
export let command = 'extract-xmsexamples <spec-path> <recordings>'
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
import util = require('util')
|
||||
import log = require('../util/logging')
|
||||
import { log } from '../util/logging'
|
||||
import validate = require('../validate')
|
||||
|
||||
export let command = 'generate-uml <spec-path>'
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
import util = require('util')
|
||||
import log = require('../util/logging')
|
||||
import { log } from '../util/logging'
|
||||
import validate = require('../validate')
|
||||
|
||||
export let command = 'generate-wireformat <spec-path>'
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
import util = require('util')
|
||||
import log = require('../util/logging')
|
||||
import { log } from '../util/logging'
|
||||
import validate = require('../validate')
|
||||
|
||||
export let command = 'resolve-spec <spec-path>'
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
import util = require('util')
|
||||
import log = require('../util/logging')
|
||||
import { log } from '../util/logging'
|
||||
import validate = require('../validate')
|
||||
|
||||
export let command = 'validate-example <spec-path>'
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
import util = require('util')
|
||||
import log = require('../util/logging')
|
||||
import { log } from '../util/logging'
|
||||
import validate = require('../validate')
|
||||
|
||||
export let command = 'validate-spec <spec-path>'
|
||||
|
|
|
@ -6,7 +6,7 @@ import JsonRefs = require('json-refs')
|
|||
import yuml2svg = require('yuml2svg')
|
||||
import utils = require('./util/utils')
|
||||
import { Constants } from './util/constants'
|
||||
import log = require('./util/logging')
|
||||
import { log } from './util/logging'
|
||||
|
||||
let ErrorCodes = Constants.ErrorCodes;
|
||||
|
||||
|
|
|
@ -45,13 +45,13 @@ let customLogLevels = {
|
|||
silly: 7
|
||||
}
|
||||
|
||||
type ILogger = winston.LoggerInstance & {
|
||||
export type ILogger = winston.LoggerInstance & {
|
||||
consoleLogLevel: any
|
||||
filepath: any
|
||||
directory: any
|
||||
}
|
||||
|
||||
let logger = new (winston.Logger)({
|
||||
export let log : ILogger = new (winston.Logger)({
|
||||
transports: [
|
||||
new (winston.transports.Console)({
|
||||
level: 'warn',
|
||||
|
@ -61,9 +61,9 @@ let logger = new (winston.Logger)({
|
|||
})
|
||||
],
|
||||
levels: customLogLevels
|
||||
})
|
||||
}) as ILogger
|
||||
|
||||
Object.defineProperties(logger, {
|
||||
Object.defineProperties(log, {
|
||||
'consoleLogLevel': {
|
||||
enumerable: true,
|
||||
get: function () { return this.transports.console.level; },
|
||||
|
@ -127,5 +127,3 @@ Object.defineProperties(logger, {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
export = (logger as any) as ILogger
|
|
@ -7,7 +7,7 @@ import util = require('util')
|
|||
import path = require('path')
|
||||
import jsonPointer from 'json-pointer'
|
||||
import YAML = require('js-yaml')
|
||||
import log = require('./logging')
|
||||
import { log } from './logging'
|
||||
import request = require('request')
|
||||
import lodash from 'lodash'
|
||||
import http = require('http')
|
||||
|
|
|
@ -6,7 +6,7 @@ import path = require('path')
|
|||
import msrest = require('ms-rest')
|
||||
import msrestazure = require('ms-rest-azure')
|
||||
import { ResourceManagementClient } from 'azure-arm-resource'
|
||||
import log = require('./util/logging')
|
||||
import { log } from './util/logging'
|
||||
import utils = require('./util/utils')
|
||||
import SpecValidator = require('./validators/specValidator')
|
||||
import WireFormatGenerator = require('./wireFormatGenerator')
|
||||
|
|
|
@ -10,7 +10,7 @@ import glob = require('glob')
|
|||
import msRest = require('ms-rest')
|
||||
import SpecValidator = require('./specValidator')
|
||||
import { Constants } from '../util/constants'
|
||||
import log = require('../util/logging')
|
||||
import { log } from '../util/logging'
|
||||
import utils = require('../util/utils')
|
||||
import models = require('../models')
|
||||
import http = require('http')
|
||||
|
|
|
@ -3,7 +3,7 @@ import path = require('path')
|
|||
import JsonRefs = require('json-refs')
|
||||
import utils = require('../util/utils')
|
||||
import { Constants } from '../util/constants'
|
||||
import log = require('../util/logging')
|
||||
import { log } from '../util/logging'
|
||||
|
||||
let ErrorCodes = Constants.ErrorCodes
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ let HttpRequest = msRest.WebResource
|
|||
import SpecResolver = require('./specResolver')
|
||||
import utils = require('../util/utils')
|
||||
import { Constants } from '../util/constants'
|
||||
import log = require('../util/logging')
|
||||
import { log } from '../util/logging'
|
||||
import { ResponseWrapper } from '../models/responseWrapper'
|
||||
import ValidationResponse = require('../util/validationResponse')
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import msRest = require('ms-rest')
|
|||
|
||||
let HttpRequest = msRest.WebResource
|
||||
|
||||
import log = require('./util/logging')
|
||||
import { log } from './util/logging'
|
||||
import SpecResolver = require('./validators/specResolver')
|
||||
import { ResponseWrapper } from './models/responseWrapper'
|
||||
import { MarkdownHttpTemplate } from './templates/markdownHttpTemplate'
|
||||
|
|
|
@ -6,7 +6,7 @@ import fs = require('fs')
|
|||
import pathlib = require('path')
|
||||
import recursive = require('recursive-readdir')
|
||||
import utils = require('./util/utils')
|
||||
import log = require('./util/logging')
|
||||
import { log } from './util/logging'
|
||||
|
||||
/**
|
||||
* @class
|
||||
|
|
Загрузка…
Ссылка в новой задаче