1

console.log vs Durandal system.log i am trying to understand if they are a like, I believe that they both gives the same output - logs in the console

Am i missing something?

Eran Meir
  • 923
  • 3
  • 17
  • 32

1 Answers1

2

You're right. They give the exact same output except that system.log can be disabled. It will also work with most if not all browsers.

As mentioned in the documentation for system.log:

Logs data to the console. Pass any number of parameters to be logged. Log output is not processed if the framework is not running in debug mode.

Debug mode is enabled using system.debug.

You can view the source code of system.log on Github.

KavenG
  • 161
  • 1
  • 9
  • So, it's better to use `System.log` with Durandal, as they "know" how to work together.. i understood it right? – Eran Meir May 10 '16 at 07:43
  • It's better to use system.log with Durandal since it works everywhere and you can disable it. Also, please mark my answer as correct if it answers your question. – KavenG May 17 '16 at 12:46