Skip to content
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

Typescript support #19

Closed
MikeMitterer opened this issue May 30, 2019 · 3 comments
Closed

Typescript support #19

MikeMitterer opened this issue May 30, 2019 · 3 comments

Comments

@MikeMitterer
Copy link

Please add TS definitions to your module

@Download
Copy link
Owner

Can you help me with a PR please?

@Download
Copy link
Owner

@MikeMitterer
How much do you know about Typescript?

I am working on v2 of ulog and it will be using a new concept. It will be the first native implementation of anylogger. The idea behind anylogger is to build the most lightweight logging shim I can and then use it as a logging facade. This way libraries can use anylogger to do logging and in the application you can select the logging framework and all libraries will start to use it automatically:

my-lib.js

var log = require('anylogger')('my-lib')
log('logging is easy!')

In application code, you require (the adapter for) your logging framework:

var ulog = require('ulog') // ulog has native anylogger support, no adapter needed :)
var log = ('anylogger')('app')
log('test') 
// no output shows as default level is info and this message is logged at log

// enable debug mode for all loggers
ulog.enable('*')
log('test 2') 
// > "test 2"

// ulog is now also being used by my-lib
require('my-lib') 
// > "logging is easy!"

As you can see, anylogger would be a simple logging facade for libraries to use. So it would be very useful for it to have Typescript definitions I think. But I never worked with Typescript and I am not sure how to make such files. Would you care to take a look at the anylogger project? v2 of ulog will be relying on anylogger so if you make a typescript definition for that one ulog will also benefit from it.

jirutka added a commit to jirutka/ulog that referenced this issue Aug 27, 2019
jirutka added a commit to jirutka/ulog that referenced this issue Aug 27, 2019
@Download
Copy link
Owner

See #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants