Comments (3)
Well I'm glad you pointed this out, apparently my logger has not been logging to my error.log
file... damn. I'll be redacting my post before as a "solution", like you said, it really only suppresses the ts warnings, apparently it's still busted.
from coinbase-pro-trading-toolkit.
Sounds like your use case is more advanced than mine, in which case this probably won't be helpful for you... but for others that run into this new issue here has been my work around customizing the logger after this winston update:
this only suppresses the typescript warning. logger is still not working.
import * as winston from 'winston';
import * as GTT from 'gdax-trading-toolkit';
import {Logger} from 'gdax-trading-toolkit/build/src/utils';
// Application logger
export const logger: Logger = GTT.utils.ConsoleLoggerFactory({
level: 'debug',
colorize: true
});
// It's still possible to use 'transports', bracket notation suppresses ts warnings
logger['transports'] = [
new winston.transports.Console({
colorize: 'all',
json: false,
timestamp: true
}),
new winston.transports.File({filename: 'error.log', level: 'error'}),
// new winston.transports.File({ filename: 'debug.log', level: 'debug' })
];
from coinbase-pro-trading-toolkit.
that's a neat trick for suppressing the typescript warnings and perhaps I'm misreading the updated code in ConsoleLoggerFactory but the logger instance from winston is hidden in a closure. So the object that is passed back is akin to:
function ConsoleLoggerFactory() {
let logger = new winston.Logger()
let returnedObj = {
log: logger.log,
error: logger.error
}
return returnedObj;
}
It's obviously not quite like this but just trying to illustrate that the winston logger instance is not actually available in the returned (gdax-tt)Logger
instance.
So, to my understanding at least, you are attaching a new transport to the returned object, which would work if you were attaching it to the logger instance but I'm not sure how it would work attaching it to the returned Logger object. You would essentially end up with
{
log: logger.log,
error: logger.error,
transports: winstonTransportInstance
}
from coinbase-pro-trading-toolkit.
Related Issues (20)
- No documented way to access Level3 orderbook HOT 2
- Access Heartbeat from GDAXFeed HOT 1
- Can't Run .js Code HOT 2
- gdaxConsole.ts -- Promise' only refers to a type, but is being used as a value here. HOT 1
- Memory leak? HOT 4
- Close issue in bitfinex feed. HOT 1
- Intermittent response messages from GDAX HOT 6
- Project status / future development? HOT 4
- t005alertTrader.ts gdaxAPI.placeOrder() error
- Array vomit in console HOT 3
- auth'd web socket doesn't work HOT 4
- "limit" order on Coinbase executes as market order HOT 1
- ccxt: LoadTicker(), ticker's bid value is populated with ask and vice versa HOT 1
- Trader.placeOrder fails on sandbox but GDAXExchangeAPI.placeOrder succeeds HOT 1
- Question: possible to have Trader and LiveOrderbook running simultaneously HOT 2
- Trader placeOrder catch err.asMessage UnhandledRejection HOT 1
- LiveOrderbook no longer processing tradeExecuted and tradeFinalized messages. HOT 3
- Calculation for 12h and 1d is incorrect in IntervalInMS HOT 1
- t002_liveOrderbook.ts SyntaxError: Unexpected token * 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 coinbase-pro-trading-toolkit.