@inward/extension-logging
Version:
LoopBack Logging for Winston and Fluentd
31 lines • 985 B
JavaScript
;
// Copyright IBM Corp. 2019,2020. All Rights Reserved.
// Node module: @inward/extension-logging
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
Object.defineProperty(exports, "__esModule", { value: true });
exports.logInvocation = void 0;
const context_1 = require("@inward/context");
const keys_1 = require("../keys");
/**
* `@logInvocation` decorator for method invocations.
*
* @example
* ```ts
* import {logInvocation} from '@inward/extension-logging';
*
* export class HelloController {
* @logInvocation()
* hello(name: string) {
* return `Hello, ${name}`;
* }
* }
* ```
*/
function logInvocation() {
// A shortcut to `@intercept` that invokes the winston interceptor that logs
// method invocations
return context_1.intercept(keys_1.LoggingBindings.WINSTON_INVOCATION_LOGGER);
}
exports.logInvocation = logInvocation;
//# sourceMappingURL=logging.decorator.js.map