You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2020/09/15 08:51:12 UTC
[incubator-echarts] 03/03: chore: tweak log.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
commit 85c9b4c4b6faa5aef8694b8f52d1b36e8e0744c5
Author: 100pah <su...@gmail.com>
AuthorDate: Tue Sep 15 16:50:10 2020 +0800
chore: tweak log.
---
src/chart/custom.ts | 6 +++---
src/util/log.ts | 6 ++++++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/chart/custom.ts b/src/chart/custom.ts
index 7cac6ea..0c645f8 100644
--- a/src/chart/custom.ts
+++ b/src/chart/custom.ts
@@ -19,7 +19,7 @@
import {
hasOwn, assert, isString, retrieve2, retrieve3, defaults, each,
- keys, isArrayLike, bind, logError, isFunction, eqNaN
+ keys, isArrayLike, bind, isFunction, eqNaN
} from 'zrender/src/core/util';
import * as graphicUtil from '../util/graphic';
import { setDefaultStateProxy, enableHoverEmphasis } from '../util/states';
@@ -81,7 +81,7 @@ import {
import Transformable from 'zrender/src/core/Transformable';
import { ItemStyleProps } from '../model/mixin/itemStyle';
import { cloneValue } from 'zrender/src/animation/Animator';
-import { warn } from '../util/log';
+import { warn, error } from '../util/log';
import { morphPath } from 'zrender/src/tool/morphPath';
@@ -1571,7 +1571,7 @@ function createOrUpdateItem(
function applyShapeMorphingAnimation(oldEl: Element, el: Element, seriesModel: SeriesModel, dataIndex: number) {
if (!((oldEl instanceof graphicUtil.Path) && (el instanceof graphicUtil.Path))) {
if (__DEV__) {
- logError('`morph` can only be applied on two paths.');
+ error('`morph` can only be applied on two paths.');
}
return;
}
diff --git a/src/util/log.ts b/src/util/log.ts
index 4e443f6..527051c 100644
--- a/src/util/log.ts
+++ b/src/util/log.ts
@@ -40,6 +40,12 @@ export function warn(str: string) {
}
}
+export function error(str: string) {
+ if (hasConsole) {
+ console.error(ECHARTS_PREFIX + str);
+ }
+}
+
export function deprecateLog(str: string) {
if (__DEV__) {
if (storedLogs[str]) { // Not display duplicate message.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org