@loopback/logging
Version:
An extension exposes logging for Winston and Fluentd with LoopBack 4
31 lines • 993 B
JavaScript
;
// Copyright IBM Corp. and LoopBack contributors 2019,2020. All Rights Reserved.
// Node module: @loopback/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 core_1 = require("@loopback/core");
const keys_1 = require("../keys");
/**
* `@logInvocation` decorator for method invocations.
*
* @example
* ```ts
* import {logInvocation} from '@loopback/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 (0, core_1.intercept)(keys_1.LoggingBindings.WINSTON_INVOCATION_LOGGER);
}
exports.logInvocation = logInvocation;
//# sourceMappingURL=logging.decorator.js.map