Skip to content

Commit c12eb6f

Browse files
committed
Replace printStackTrace() with logging
1 parent 0dbe698 commit c12eb6f

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
- Upgraded Android Gradle Plugin to 8.10.1
1313
- Fixed various Gradle-related deprecations
14+
- Replaced `printStackTrace()` with logging
1415

1516

1617
## [v1.4.2] (68) 煮者 (2025-01-12)

app/src/main/java/io/github/yawnoc/strokeinput/Keyboard.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import android.content.res.XmlResourceParser;
2727
import android.graphics.Color;
2828
import android.util.DisplayMetrics;
29+
import android.util.Log;
2930
import android.util.Xml;
3031

3132
import java.util.ArrayList;
@@ -38,6 +39,8 @@
3839
*/
3940
public class Keyboard
4041
{
42+
private static final String LOG_TAG = "Keyboard";
43+
4144
private static final String KEYBOARD_TAG = "Keyboard";
4245
private static final String ROW_TAG = "Row";
4346
private static final String KEY_TAG = "Key";
@@ -203,7 +206,7 @@ else if (inRow)
203206
}
204207
catch (Exception exception)
205208
{
206-
exception.printStackTrace();
209+
Log.e(LOG_TAG, "makeKeyboard failed", exception);
207210
}
208211
}
209212

app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ private void loadSequenceCharactersData(
249249
}
250250
catch (IOException exception)
251251
{
252-
exception.printStackTrace();
252+
Log.e(LOG_TAG, "loadSequenceCharactersData failed", exception);
253253
}
254254

255255
final long endMilliseconds = System.currentTimeMillis();
@@ -276,7 +276,7 @@ private void loadCharactersData(final String charactersFileName, final Set<Integ
276276
}
277277
catch (IOException exception)
278278
{
279-
exception.printStackTrace();
279+
Log.e(LOG_TAG, "loadCharactersData failed", exception);
280280
}
281281

282282
final long endMilliseconds = System.currentTimeMillis();
@@ -319,7 +319,7 @@ private void loadRankingData(
319319
}
320320
catch (IOException exception)
321321
{
322-
exception.printStackTrace();
322+
Log.e(LOG_TAG, "loadRankingData failed", exception);
323323
}
324324

325325
final long endMilliseconds = System.currentTimeMillis();
@@ -346,7 +346,7 @@ private void loadPhrasesData(final String phrasesFileName, final Set<String> phr
346346
}
347347
catch (IOException exception)
348348
{
349-
exception.printStackTrace();
349+
Log.e(LOG_TAG, "loadPhrasesData failed", exception);
350350
}
351351

352352
final long endMilliseconds = System.currentTimeMillis();

0 commit comments

Comments
 (0)