Comments (4)
You could do something like this as long as your logger conforms to the same (normal?) logging interface with info/debug/error/etc methods.
var client = new Slack(...)
client.logger = yourOwnLogger
client.login()
Manually messing with instance variables like that probably isn't the greatest thing in the world, so maybe something like client.setLogger()
or an argument in the constructor would be a little nicer. But it should be possible currently.
from node-slack-sdk.
Thanks - that's a great fix for now. We're looking into doing some re-design work on the client and I'll ensure that getting a better logging setup gets wrapped into the feature bucket for that
from node-slack-sdk.
Having a method to change the logger is indeed a better solution while changing the instance variable is a nice temporary hack. In case this feature is added to the client, would be just necessary to clearly define the logging interface since there is multiple standards for the methods names (error vs. err, warn ing vs. warn).
from node-slack-sdk.
Ok, first off, I apologize for how long it's taken us to resolve this issue.
I just pushed the 2.0.0 release for this library, which is a ground up refactor with the aim of building a lib that both Slack and our external contributors can easily work with and improve.
It also allows you to pass in your own logger function when you construct a client, for example:
var RtmClient = require('slack-client').RtmClient;
var token = process.env.SLACK_API_TOKEN || '';
var rtm = new RtmClient(token, { logLevel: 'debug', logger: function() {} });
rtm.start();
rtm.on('message', function handleRtmMessage(message) {
console.log(message);
});
So, I'd suggest that the best way to resolve these issues is to upgrade to the latest version. If you have any problems in doing that, please create a new issue and I'll try and help you in there.
from node-slack-sdk.
Related Issues (20)
- types: add type tests via tsd
- Web-sdk not compatible with CRA? HOT 5
- Is it possible to get typing event or indicator when a user in slack starts typing in a message HOT 2
- Typescript type error for `web.files.uploadV2()` arguments when using `file_uploads` HOT 2
- Missing exported types (Channel, etc) HOT 7
- Bun runtime support for @slack/web-api HOT 1
- Way to disable message content being logged HOT 3
- files.upload method returns warning message "files.upload may cause some issues like timeouts for relatively large files." HOT 4
- Main thread crashes due to unhandled error from @slack/web-api SDK HOT 3
- Update files.upload Documentation on Slack API Website for files.uploadV2 HOT 4
- 'process is not defined' in react vite HOT 1
- The icon_url option on chat.postMessage does not seem to affect the preview avatar image shown in the thread reply summary HOT 3
- Please support `AbortSignal` HOT 2
- Document inconsistency: checkboxes block element's description can have both plain_text and mrkdwn HOT 2
- icon_url is not working in thread replies.
- socket-mode: Type event payloads HOT 1
- web-api: Consider removing need to provide empty object as argument to zero-argument methods HOT 2
- web-api: Consider removing empty interfaces HOT 5
- Unhandled event 'websocket open' in state 'connected'. HOT 8
- sharedPublicURL rejects with error "not_allowed" for no clear reason HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-slack-sdk.