-
Notifications
You must be signed in to change notification settings - Fork 15
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
init sveltekit library #198
base: main
Are you sure you want to change the base?
Conversation
I'm looking at the example code, and I want this. Been waiting for this for a while. Let's go @schehata!!!! |
I'd also like to know how this will work with my Sentry integration! How will Sentry and Axiom handle the |
|
||
|
||
console.log({ token: AXIOM_TOKEN, dataset: AXIOM_DATASET, url: AXIOM_URL }) | ||
const logger = new Logger({ token: AXIOM_TOKEN, dataset: AXIOM_DATASET, url: AXIOM_URL }, { runtime: resolveRuntime(), dev, browser, version }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logger expects a single object; there are two objects here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we could add dev
browser
, and version
as optional properties of LoggerConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to pass it as args when calling the logger.error/info
than the above.
Figured it out. I can pass custom error handler to |
|
||
export type LoggerConfig = { | ||
args?: { [key: string]: any }; | ||
url?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This url
can also be ditched as this is never used here and is only used at the api/axiom
endpoint created by the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also add dev
, browser
, and version
here to make the server-side logs parity. In both versions, we can get rid of the browser
arg and hardcode it like you've done here for runtime
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to pass dev
, browser
, and version
when calling logger.error/info
instead of the above method, which essentially does nothing.
Fixing Sveltekit package issues and its implementation in example app
@schehata I have made some changes to the codebase based on the discussion in this PR. I've also made PR #207 for it. |
Fixing Sveltekit package and example issues
@jerriclynsjohn I have update the README, to give us a starting doc. We will have to improve, and hopefully @tothmano when he is back. There is 2 things that we need to do, and then its ready in my opinion:
|
aaah, the build process is trying to send logs to Axiom, not sure if we want that: |
Create a library to support logging from sveltekit.