autoreggol
Advanced tools
Comparing version 0.3.1 to 0.4.0
@@ -12,5 +12,5 @@ export type Level = "fatal" | "error" | "warn" | "info" | "debug" | "trace"; | ||
level?: Level; | ||
enablePropertyLoging?: boolean; | ||
enablePropertyLogging?: boolean; | ||
enableLogging?: boolean; | ||
} | ||
export type LogFunction = (ctr: ConstructorType, targetKey: string | symbol, targetValue: any, level: Level) => void; |
import "reflect-metadata"; | ||
import { AutoLogOptions, ConstructorType } from "./base"; | ||
declare function AutoLog({ logger, level, enablePropertyLoging, enableLogging, }: AutoLogOptions): <T extends ConstructorType>(constructor: T) => T; | ||
declare function AutoLog({ logger, level, enablePropertyLogging, enableLogging, }: AutoLogOptions): <T extends ConstructorType>(constructor: T) => T; | ||
export { AutoLog }; | ||
@@ -5,0 +5,0 @@ export * from "./base"; |
@@ -20,3 +20,3 @@ "use strict"; | ||
require("reflect-metadata"); | ||
function AutoLog({ logger, level = "info", enablePropertyLoging = false, enableLogging = true, }) { | ||
function AutoLog({ logger, level = "info", enablePropertyLogging = false, enableLogging = true, }) { | ||
return function _autolog(constructor) { | ||
@@ -47,3 +47,3 @@ var _a; | ||
else { | ||
if (enablePropertyLoging && !bypassLogging) { | ||
if (enablePropertyLogging && !bypassLogging) { | ||
logger(constructor, propKey, targetValue, LEVEL); | ||
@@ -50,0 +50,0 @@ } |
{ | ||
"name": "autoreggol", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "A collection of handy auto logging decorators.", | ||
@@ -24,3 +24,3 @@ "author": "Ronnie Magatti <ronniemagatti@gmail.com>", | ||
"type": "git", | ||
"url": "git@github.com:rmagatti/autoreggol.git" | ||
"url": "git+ssh://git@github.com/rmagatti/autoreggol.git" | ||
}, | ||
@@ -27,0 +27,0 @@ "engines": { |
@@ -18,3 +18,3 @@ # Auto Reggol | ||
```typescript | ||
@AutoLog({ logger, level: "debug", enablePropertyLoging: true }) | ||
@AutoLog({ logger, level: "debug", enablePropertyLogging: true }) | ||
class Example {} | ||
@@ -38,3 +38,3 @@ ``` | ||
@AutoLog({ logger, level: "debug", enablePropertyLoging: true }) | ||
@AutoLog({ logger, level: "debug", enablePropertyLogging: true }) | ||
class Example { | ||
@@ -41,0 +41,0 @@ private a = "foo"; |
Sorry, the diff of this file is not supported yet
15394