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

log server events to logFunction #78

Merged
merged 2 commits into from
Aug 5, 2016
Merged

log server events to logFunction #78

merged 2 commits into from
Aug 5, 2016

Conversation

helfer
Copy link
Contributor

@helfer helfer commented Aug 5, 2016

TODO:

  • Update CHANGELOG.md with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

@nnance
Copy link
Contributor

nnance commented Aug 5, 2016

So what about a more TypeScript approach:

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});

I know this is more verbose but avoids string matching / parsing and makes it much easier for the consumer. I wouldn't mind making the change to your PR if you like it.

@helfer helfer merged commit adf5727 into master Aug 5, 2016
@helfer helfer deleted the add-tracer branch September 20, 2016 03:46
@nnance nnance restored the add-tracer branch September 20, 2016 16:19
@nnance nnance deleted the add-tracer branch September 20, 2016 16:24
trevor-scheer pushed a commit that referenced this pull request May 6, 2020
trevor-scheer pushed a commit that referenced this pull request May 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants