Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DebugProcessor that can wrap a processor and log out debugging information #99

Closed
pathurs opened this issue Oct 13, 2020 · 1 comment
Labels

Comments

@pathurs
Copy link
Member

pathurs commented Oct 13, 2020

Example:

class DebugProcessor<T> extends ComplexProcessor<T> {
    public constructor(
        private readonly dataSourceName: string,
        private readonly processorName: string,
        private readonly wrapperProcessor: ComplexProcessor<T>
    ) {
        super(wrapperProcessor.value);
    }

    protected processor(data: T): T {
        console.log(`DebugProcess(pre): ${this.dataSourceName} ${this.processorName}`, data);

        const result = this.wrapperProcessor.process(data);

        console.log(`DebugProcess(post): ${this.dataSourceName} ${this.processorName}`, result);

        return result;
    }
}
github-actions bot pushed a commit that referenced this issue Oct 20, 2020
# [3.2.0](v3.1.2...v3.2.0) (2020-10-20)

### Features

* **DebugProcessor:** add DebugProcessor ([e059b97](e059b97)), closes [#99](#99)
@github-actions
Copy link

This issue has been resolved in release v3.2.0!

You can install the npm package for v3.2.0 using npm install @colonise/datasource@3.2.0

Automatically generated by semantic-release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant