Comments (3)
The issue seems to be with the fact that logger.log
calls logger.debug
(since they both perform the same duty), which moves the actual caller a line down in the stack trace.
Fixing this should be a simple matter of just moving the logic for figuring out which line called the logger to the initial logging functions themselves (and not logger.write
).
from yatsl.
Pushed a bandaid fix in #19, but I should figure out a better way of getting the line for next minor revision.
from yatsl.
I don't think the public log
function should call debug
as that is a public function and from the current TODO statement, it looks like you are attempting to make an exception to a function call.
If you want both functions to have the same behaviour, then point them to the same private function. That woud make getCallSignature
break. A solution would be to generate the error at the top public function level and then pass it down to getCallSignature
. Then the stack would always be just one level too deep.
from yatsl.
Related Issues (20)
- Browser Detection
- Add the ability to specify config overrides within the logging functions
- Breaks on TypeScript 4.7 with ts-node HOT 2
- Add environment variable support
- Add the ability to specify seperate minimum log levels for each stream
- Add the ability to manually specify which log levels to log
- Update README and Documentation to accomodate for vanilla JavaScript users
- Add the ability to update last line instead of writing a new one
- Fix tabs = false behaviour HOT 1
- Detect and handle circular structures when logging objects
- Rewrite tests to be less cumbersome HOT 1
- Timestamps in strings in object logging mode are broken
- JSON.stringify removes information from objects HOT 1
- Current version breaks in browsers
- Line logging is broken on Windows
- Implement Unit Testing HOT 1
- Automate pushing to npm HOT 1
- Object pretty-print HOT 1
- Override settings for a log call HOT 1
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 yatsl.