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

Improve logging function #79

Closed
nnance opened this issue Aug 5, 2016 · 0 comments
Closed

Improve logging function #79

nnance opened this issue Aug 5, 2016 · 0 comments
Assignees
Milestone

Comments

@nnance
Copy link
Contributor

nnance commented Aug 5, 2016

Take a more TypeScript approach to logging

export enum LogAction {
request, parse, validation, execute
}

export enum LogStep {
start, end
}

export interface LogMessage {
action: LogAction;
step: LogStep;
data?: Object;
}

export interface LogFunction {
(message: LogMessage);
}

export interface QueryOptions {
...
logFunction?: LogFunction;
...
}

Then use it like this:
logFunction({action: LogAction.request, step: LogStep.start});

This is more verbose but avoids string matching / parsing and makes it much easier for the consumer.

@helfer helfer added this to the 0.3 milestone Aug 27, 2016
@nnance nnance self-assigned this Sep 9, 2016
@nnance nnance mentioned this issue Sep 10, 2016
4 tasks
@nnance nnance added the ready label Sep 10, 2016
@nnance nnance closed this as completed Sep 10, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants