Skip to content

Commit

Permalink
fix: logs messages
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Jun 30, 2022
1 parent b2ee4be commit e0d9bf5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public BundleInfo getBundleInfo(String id) {
if(id == null) {
id = BundleInfo.VERSION_UNKNOWN;
}
Log.d(TAG, "Getting info for [" + id + "]");
Log.d(TAG, "Getting info for bundle [" + id + "]");
BundleInfo result;
if(BundleInfo.ID_BUILTIN.equals(id)) {
result = new BundleInfo(id, (String) null, BundleStatus.SUCCESS, "");
Expand All @@ -427,7 +427,7 @@ public BundleInfo getBundleInfo(String id) {
String stored = this.prefs.getString(id + INFO_SUFFIX, "");
result = BundleInfo.fromJSON(stored);
} catch (JSONException e) {
Log.e(TAG, "Failed to parse id info for [" + id + "] ", e);
Log.e(TAG, "Failed to parse info for bundle [" + id + "] ", e);
result = new BundleInfo(id, (String) null, BundleStatus.PENDING, "");
}
}
Expand Down Expand Up @@ -457,19 +457,19 @@ private void saveBundleInfo(final String id, final BundleInfo info) {
}

if(info == null) {
Log.d(TAG, "Removing info for [" + id + "]");
Log.d(TAG, "Removing info for bundle [" + id + "]");
this.editor.remove(id + INFO_SUFFIX);
} else {
final BundleInfo update = info.setId(id);
Log.d(TAG, "Storing info for [" + id + "] " + update.toString());
Log.d(TAG, "Storing info for bundle [" + id + "] " + update.toString());
this.editor.putString(id + INFO_SUFFIX, update.toString());
}
this.editor.commit();
}

public void setVersionName(final String id, final String name) {
if(id != null) {
Log.d(TAG, "Setting name for id [" + id + "] to " + name);
Log.d(TAG, "Setting name for bundle [" + id + "] to " + name);
BundleInfo info = this.getBundleInfo(id);
this.saveBundleInfo(id, info.setVersionName(name));
}
Expand All @@ -478,7 +478,7 @@ public void setVersionName(final String id, final String name) {
private void setBundleStatus(final String id, final BundleStatus status) {
if(id != null && status != null) {
BundleInfo info = this.getBundleInfo(id);
Log.d(TAG, "Setting status for [" + id + "] to " + status);
Log.d(TAG, "Setting status for bundle [" + id + "] to " + status);
this.saveBundleInfo(id, info.setStatus(status));
}
}
Expand Down
6 changes: 3 additions & 3 deletions ios/Plugin/CapacitorUpdater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,16 @@ extension CustomError: LocalizedError {
}

public func getBundleInfo(id: String = BundleInfo.ID_BUILTIN) -> BundleInfo {
print("\(self.TAG) Getting info for [\(id)]")
print("\(self.TAG) Getting info for bundle [\(id)]")
if(BundleInfo.ID_BUILTIN == id) {
return BundleInfo(id: id, version: "", status: BundleStatus.SUCCESS)
}
do {
let result: BundleInfo = try UserDefaults.standard.getObj(forKey: "\(id)\(self.INFO_SUFFIX)", castTo: BundleInfo.self)
print("\(self.TAG) Returning info [\(id)]", result.toString())
print("\(self.TAG) Returning info bundle [\(id)]", result.toString())
return result
} catch {
print("\(self.TAG) Failed to parse version info for [\(id)]", error.localizedDescription)
print("\(self.TAG) Failed to parse info for bundle [\(id)]", error.localizedDescription)
return BundleInfo(id: id, version: "", status: BundleStatus.PENDING)
}
}
Expand Down

0 comments on commit e0d9bf5

Please sign in to comment.