From 8af3f37f5a6dec31877b0c67c996cb52f513d020 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sun, 15 Mar 2015 12:58:23 +0200 Subject: client: add util.log_error, use for clone missing dst/src ids --- src/client/model/graph.js | 4 ++-- src/client/util.js | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/model/graph.js b/src/client/model/graph.js index 9662378c..f8783127 100644 --- a/src/client/model/graph.js +++ b/src/client/model/graph.js @@ -796,11 +796,11 @@ function Graph(spec) { link_spec.__dst = find_node__by_id(dst_id); if (null === link_spec.__src) { - console.log("src_id not found: " + src_id); + util.log_error("src_id not found: " + src_id); return null; } if (null === link_spec.__dst) { - console.log("dst_id not found: " + dst_id); + util.log_error("dst_id not found: " + dst_id); return null; } diff --git a/src/client/util.js b/src/client/util.js index d2114e4c..20dff15a 100644 --- a/src/client/util.js +++ b/src/client/util.js @@ -228,6 +228,11 @@ define(['jquery'], function($) { return ret; } + // logging helpers + function log_error(msg) { + console.log('error: ' + msg); + } + return { array_diff: array_diff, assert: assert, @@ -242,5 +247,7 @@ define(['jquery'], function($) { set_diff: set_diff, setSelection: setSelection, selectionStart: selectionStart, + + log_error: log_error, }; }); -- cgit v1.3.1