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

Universal support (browser + server) #5

Open
Vadorequest opened this issue Dec 3, 2020 · 4 comments
Open

Universal support (browser + server) #5

Vadorequest opened this issue Dec 3, 2020 · 4 comments

Comments

@Vadorequest
Copy link

Is your feature request related to a problem? Please describe.
Currently, the logt utility seems to be only available in the browser. Some functions like readConsole seem to target the browser console global object. It is unclear if it's usable on the server.

Is this tool usable for the server side too? Is it universal?

Also, how do you specify the "filename" in the below screenshot? (taken from your twitter post)
image

Is it done manually, is it automated?

@sidhantpanda
Copy link
Owner

Hey @Vadorequest LogT is currently only available for browsers as colorizing terminal outputs requires separate work.

Can extend it to work in servers as well, if I get the time :)

@Vadorequest
Copy link
Author

Thank you.

I'm currently trying to figure out which logger I should incorporate to Next Right Now. I'm currently considering both LogT and ulog. Have you heard of the latter?

Also, could you share an example about how you did the main.xs to be blue in the above screenshot?

My goal is to log the level/time/filename and the message(s) with an API that is consistent with the console native object (both on Client and Server).

@sidhantpanda
Copy link
Owner

The label in blue is the LOG_TAG. Achieved here with :

logger.info("main.xs", "example info");

@sidhantpanda
Copy link
Owner

Had not heard of ulog before. Checked it out, their library size is ~2.8kb when bundled. But the added bloat might be unnecessary to ship to the frontend.

It might be better to have a separate library for backend, if you care about that kind of optimisation. Might be better to write a new library logt-server that caters to purely backend, and adheres to the exact same class definitions.

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

No branches or pull requests

2 participants