Attention: the list was moved to
This page is not maintained anymore, please update your bookmarks.
Every time I start a new project, I want to pull in a
log function that allows the same functionality as the
console.log, including the full functionality of the Console API.
There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where
log was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.
This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:
|# MOJAVE: https://gist.github.com/kevmt/476716bfb0383d3fda699e4fcacc6470|
|# install brew|
|/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"|
|# Terminal Aliases|
|echo "alias artisan='php $PWD/artisan'" >> ~/.bash_profile|
|echo "export NVM_DIR=~/.nvm" >> ~/.bash_profile|
|echo "source $(brew --prefix nvm)/nvm.sh" >> ~/.bash_profile|