Skip to main content
added 57 characters in body
Source Link
candied_orange
  • 118.2k
  • 27
  • 224
  • 362

Have you heard of closures?

log = buildLog(debug)

...

log("Something ya wanna log")

Now you can control logging globally or your can control it locally by only passing the enabled log function to the few things that need it right now. This little scheme combines well with default arguments.

Have you heard of closures?

log = buildLog(debug)

...

log("Something ya wanna log")

Now you can control logging globally or your can control it locally by only passing the enabled log function to the few things that need it right now.

Have you heard of closures?

log = buildLog(debug)

...

log("Something ya wanna log")

Now you can control logging globally or your can control it locally by only passing the enabled log function to the few things that need it right now. This little scheme combines well with default arguments.

edited body
Source Link
candied_orange
  • 118.2k
  • 27
  • 224
  • 362

Have you heard of closures?

log = buildLog(debug)

...

log("Something ya wanna log")

Now you can control logging globally or your can control it locally by only passing the enabled log fucntionfunction to the few things that need it right now.

Have you heard of closures?

log = buildLog(debug)

...

log("Something ya wanna log")

Now you can control logging globally or your can control it locally by only passing the enabled log fucntion to the few things that need it right now.

Have you heard of closures?

log = buildLog(debug)

...

log("Something ya wanna log")

Now you can control logging globally or your can control it locally by only passing the enabled log function to the few things that need it right now.

[Edit removed during grace period]
Source Link
candied_orange
  • 118.2k
  • 27
  • 224
  • 362
Source Link
candied_orange
  • 118.2k
  • 27
  • 224
  • 362
Loading