simple-log-methods
Version:
a simple and opinionated logging library. plays well with aws lambda + cloudwatch.
21 lines (20 loc) • 635 B
TypeScript
import type { Procedure, ProcedureContext } from 'domain-glossary-procedure';
import type { LogMethods } from '../logic/generateLogMethods';
/**
* .what = the procedure invocation trail
*/
export type LogTrail = string[];
export interface ContextLogTrail {
/**
* .what = the log context which can be used; methods, trail, etc
*/
log: LogMethods & {
_orig?: LogMethods;
} & {
/**
* .what = the log trail which has been collected
*/
trail?: LogTrail;
};
}
export type HasContextLogTrail<T extends Procedure> = ProcedureContext<T> extends ContextLogTrail ? T : never;