Skip to content

Commit 5adf6b5

Browse files
committed
Revert changes to logging
1 parent 87ff628 commit 5adf6b5

File tree

8 files changed

+11
-15
lines changed

8 files changed

+11
-15
lines changed

src/components/Svg/TextPath.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ export default class TextPath extends React.Component<Props> {
1111

1212
render() {
1313
if (!this.props.href || !this.props.href.match(idExpReg)) {
14-
if (process.env.NODE_ENV !== 'production')
15-
console.warn(
16-
`Invalid \`href\` prop for \`TextPath\` element, expected a href like \`"#id"\`, but got: "${this.props.href}"`,
17-
);
14+
console.warn(
15+
`Invalid \`href\` prop for \`TextPath\` element, expected a href like \`"#id"\`, but got: "${this.props.href}"`,
16+
);
1817
}
1918

2019
const { children, ...rest } = this.props;

src/components/Svg/Use.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ export default class Use extends React.Component<Props> {
2222
const matched = href.match(idExpReg);
2323

2424
if (!href || !matched) {
25-
if (process.env.NODE_ENV !== 'production')
26-
console.warn(
27-
`Invalid \`href\` prop for \`Use\` element, expected a href like \`"#id"\`, but got: "${href}"`,
28-
);
25+
console.warn(
26+
`Invalid \`href\` prop for \`Use\` element, expected a href like \`"#id"\`, but got: "${href}"`,
27+
);
2928
}
3029
const { children, ...rest } = this.props;
3130
return <svg_use {...rest}>{children}</svg_use>;

src/jsonUtils/sketchJson/convertJsonToSketch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function convertJsonToSketch(
2323
);
2424

2525
if (err.value() !== null) {
26-
if (process.env.NODE_ENV !== 'production') console.error(err.value());
26+
console.error(err.value());
2727
throw new Error(err.value());
2828
}
2929

src/jsonUtils/sketchJson/convertSketchToJson.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function convertSketchToJson(
1313
const data = MSJSONDataArchiver.archiveStringWithRootObject_error(imm, err);
1414

1515
if (err.value() !== null) {
16-
if (process.env.NODE_ENV !== 'production') console.error(err.value());
16+
console.error(err.value());
1717
throw new Error(err.value());
1818
}
1919

src/render.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export default async function render(
140140
const layer = await renderTree(tree, nativeContainer, platformBridge);
141141
return layer;
142142
} catch (err) {
143-
if (process.env.NODE_ENV !== 'production') console.error(err);
143+
console.error(err);
144144
const tree = buildTree(<RedBox error={err} />, platformBridge);
145145
return renderContents(tree, nativeContainer, platformBridge);
146146
}

src/symbol.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ export const injectSymbols = (
7171
document?: SketchDocumentData | SketchDocument | WrappedSketchDocument,
7272
) => {
7373
if (!isRunningInSketch()) {
74-
if (process.env.NODE_ENV !== 'production')
75-
console.error('Cannot inject symbols while Sketch is not running');
74+
console.error('Cannot inject symbols while Sketch is not running');
7675
return;
7776
}
7877

src/utils/getImageDataFromURL.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export default async function getImageDataFromURL(
5656
sha1: sha1(data),
5757
};
5858
} catch (error) {
59-
if (process.env.NODE_ENV !== 'production')
6059
console.error(`Error while fetching '${url}':`, error);
6160

6261
return ERROR_RESULT;

src/utils/processTransform/parseTransformProp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function appendTransform(transform: string) {
168168
const [a, c, e, b, d, f] = transformParser.parse(transform);
169169
pooledMatrix.append(a, b, c, d, e, f);
170170
} catch (e) {
171-
if (process.env.NODE_ENV !== 'production') console.error(e);
171+
console.error(e);
172172
}
173173
}
174174

0 commit comments

Comments
 (0)