Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Or for the back end devs...
<?php echo '<script>console.log("debug");</script>'; ?> -
unless the app you're working on already has like 10 console.debug-s per second, and you're working on a part that's sending notifications into chat window, so you can do chatWindow.sendMessage (or whatever it's called in your app) instead, to actually be able to notice those messages.
-
retoor120094yMany ways to rome but this is one:
```
let nr = 1
console.info(nr++)
console.info('waaa')
console.info(nr++)
```
Or even better:
```
class Logger {
_nr = 0
_loggerName = 'default'
constructor(name){
this._loggerName = name
}
warn(){
console.warn(this._loggerName, this._nr++, arguments)
}
info(){
console.info(this._loggerName, this._nr++, arguments)
}
}
const z = new Logger('My Z Loggerr!!')
z.warn('It','is','incrementing and shows the logger name')
z.info('It','is','incrementing and shows the logger name')
```
Bit python style
Edit: how to show proper code indenting around here? Wasn't there a bot for that? -
eo287540014yBrowser debuggers are still crap in many situations. My webpack creates several different versions of each file, sometimes in the wrong directories
-
You do know that Chrome supports break points, right?
Tho I also think that this is the way. 🙃 -
retoor120094y@Folkmann Haha, the moment i realize i need breakpoints to figure out the issue - i realize that probably my code is too fucked already.
On topic: it is for me the way as well.
Off topic: it's a shame that i learned console.table so late. It's catshit awesome! -
@ostream Well you can run bare feet, but it’s more comfortable with shoes.
100mo ? my IDE eats around 1.5 GB of RAM (For big projects) and still it’s faster to put a breakpoint than try do debug with console.log 😊
Related Rants
console.log("debug");
.
.
.
console.log("debug1");
.
.
.
console.log("debug2");
- The only way. Try to change my mind
rant
js