Debug Logging

The shieldbow client has a built-in debug logger that can be used to debug any issues.

By default, the warning and error log levels are enabled.

You will receive a warning if there are corrupted LocalStorage files, or if you try to exceed the rate limits.

You will receive error logs, when well, there are errors.

You can disable the logger by setting the logger option to false when initializing the client.

client.initialize({  logger: false})

You can also set the log level to debug to enable debug logs.

client.initialize({  logger: {    level: 'debug'  }})

And for even more information, you can set the log level to trace.

client.initialize({  logger: {    level: 'trace'  }})

The defaults

By default, the client will log to the console.

It uses the ShieldbowLogger class, which implements ILogger interface.

You can provide your own logger by implementing the ILogger interface.

import { ILogger } from 'shieldbow'class MyLogger implements ILogger {  // ...}

Recommendations.

It is recommended that you set the level to warn in development. And set it to error in production.

If you need to debug issues, you can set the level to debug.

If you are running into an issue and cannot figure out where the issue might be, set the level to trace and share your logs with the issue to help us debug the issue.

The End