summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/helpers/log.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlebars/helpers/log.js')
-rw-r--r--lib/handlebars/helpers/log.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/handlebars/helpers/log.js b/lib/handlebars/helpers/log.js
new file mode 100644
index 0000000..ab83604
--- /dev/null
+++ b/lib/handlebars/helpers/log.js
@@ -0,0 +1,6 @@
+export default function(instance) {
+ instance.registerHelper('log', function(message, options) {
+ let level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
+ instance.log(level, message);
+ });
+}