-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Logging API support? #134
Comments
Thanks for your input, I'll see what I can do! 👍🏼 |
I agree that it would be extremely useful. Currently AceBase uses const base = new AceBaseServer("default", {
host: "localhost",
port: 8080,
logger: {
verbose: (...args) => console.log(...args),
log: (...args) => console.log(...args),
warn: (...args) => console.warn(...args),
error: (...args) => console.error(...args),
write: (...args) => console.log(...args),
}
}); Note, that your don't specify the log level here as you are handling all the levels yourself. If an override for a level is not specified, it will not be logged. @appy-one, let me know if you want me to work on PR for this. I guess we'll have to modify all the @SilentAntenna if you need a workaround right now, you can write this before instantiating your AceBase client/server: import { DebugLogger } from "acebase-core";
const logger = {
verbose: (...args) => console.log(...args),
log: (...args) => console.log(...args),
warn: (...args) => console.warn(...args),
error: (...args) => console.error(...args),
write: (...args) => console.log(...args),
setLevel: () => {},
};
Object.assign(DebugLogger.prototype, logger); With this hack you can override the |
I think this a pretty good workaround proposed by @Azarattum |
It would be nice if Acebase could provide a logging callback or a logging event. In this way, we may use libraries like
log4js
to save the logs for future inspection.The text was updated successfully, but these errors were encountered: