towergame / yatsl Goto Github PK
View Code? Open in Web Editor NEWYet Another TypeScript Logger
Home Page: https://www.npmjs.com/package/yatsl
License: MIT License
Yet Another TypeScript Logger
Home Page: https://www.npmjs.com/package/yatsl
License: MIT License
One major issue is the use of process variable by default that is Node specific and will not work in browsers.
Implement the ability to specify unique minimum log levels for each defined stream. Probably still specify a central min log level for cases where per-stream granularity is unnecesary.
The logger should detect when it's running in a browser environment and automatically apply a different configuration that plays nicer with browsers (will most likely require some redesign of how the logger logs things in a browser context, at the very least, disable ANSI, but preferably use some other method of prettying the text and making objects still explorable like with console.log)
Currently the logger throws an exception if the JSON stringifier is given a circular structure.
Ideally the logger should have a way to detect a circular structure and handle it in some way.
Add support for environment variables to, for example, specify the default minimum log level.
Supplement the typescript code blocks with JavaScript code blocks to accommodate users who use just JavaScript, as the library is also able to work on vanilla JS.
Uncertain if this is possible (TypeScript overloading is quite limited), but ideally config overrides should be able to be performed through the logging functions themselves (i.e. logger.debug)
The package logs an incorrect line reference when called.
Expected behaviour:
Calling logger.log("I live!")
on line 4 of index.ts would output:
2022-08-05T15:15:27.266Z [debug | index.ts:4:8] I live!
Actual behaviour:
Calling logger.log("I live!")
on line 4 of index.ts outputs:
2022-08-05T15:15:27.266Z [debug | index.ts:150:53] I live!
Add a logging method that allows to overwrite the last line instead of logging a new one, which would be improve readability for programs which provide progress on its current processing in the terminal.
Currently test code isn't particularly DRY and repeats itself quite often ideally it should iterate through all the logging funcs more elegantly.
Automate fetching markdown files from docs
and pushing it to the wiki.
As the title alludes, JSON.stringify
only handles JSON objects. Those are only a subset of what a Javascript object can be.
Things like class instance names or functions are simply removed in the current implementation of the private Logger.stringify
function.
Logging pure functions simply throws undefined and while rare and possibly almost never used in practice, this is highly inconsistent with the normal behaviour.
Add the ability to pass an override settings object on a log call
Malformed regex does not work with Windows handling of file systems as it uses back slashes instead of forward slashes like on Linux.
Set up a CI that automatically pushes to npm
Trying to run a project using yatsl on TypeScript 4.7 using ts-node seems to make it complain:
Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.
Removing yatsl from the code seems to let it run just fine.
Currently a mistake makes tabs = false
indent using the s
character instead of the
character.
Additionally, fix the unit test for spaces to actually detect whether the object is indented using spaces.
Implement an ability to manually specify which log levels should be logged and which shouldn't. This would be handy for cases where, for example, seperate log levels should be logged in separate files.
Set up pretty-printing for objects, perhaps even syntax highlighting
TODO list:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.