Skip to content

Commit a676d9b

Browse files
authored
Merge pull request #3 from mhughes2k/mhughes2k-js-core-module-guides-1
Create log.md
2 parents c683ab2 + ee9b1f1 commit a676d9b

File tree

1 file changed

+16
-0
lines changed
  • docs/guides/javascript/modules

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Log
3+
---
4+
5+
It is not recommended to use the vanila `window.console.log()` function to output Javascript logging information.
6+
7+
The `core/log` module offers different levels of log output that is governed by Moodle's debugging levels.
8+
9+
```js title="Example use of logging"
10+
import Log from 'core/log';
11+
12+
Log.info("Info class log statement");
13+
14+
Log.debug("Debugging information, only appears when DEBUG mode is DEBUG_DEVELOPER");
15+
16+
```

0 commit comments

Comments
 (0)