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

chore(api): Improve logging and error status code #328

Merged
merged 5 commits into from
May 11, 2022

Conversation

koistya
Copy link
Member

@koistya koistya commented May 11, 2022

If you're using import { log } from "./core" directly (as opposed ctx.log(...)), the res argument is now ommited:

import { log } from "../core";

// BEFORE
log(req, res, "WARNING", "Some text or object");

// AFTER
log(req, "WARNING", "Some text or object")

When used inside GraphQL type resolvers, nothing has changed:

async resolve(self, args, ctx) {
  ctx.log("ERROR", new Error(...));
}

@koistya koistya self-assigned this May 11, 2022
@koistya koistya merged commit 328d8df into kriasoft:main May 11, 2022
@koistya koistya deleted the logging branch May 11, 2022 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant