Skip to content

Commit f0f8b95

Browse files
chrfalchmeta-codesync[bot]
authored andcommitted
Improve logging functions (#53976)
Summary: This change remove some unnecessary logs and improve the logging functions for the prebuilds bypass-github-export-checks ## Changelog: [IOS] [CHANGED] - Updated logging functions for prebuilds Pull Request resolved: #53976 Test Plan: Run: ``` RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install ``` Reviewed By: christophpurrer Differential Revision: D83481709 Pulled By: cipolleschi fbshipit-source-id: bad358c6e6abfcb1568344e5161109dff7ee06ab
1 parent 36e1c0a commit f0f8b95

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

packages/react-native/scripts/cocoapods/rncore.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def self.setup_rncore(react_native_path, react_native_version)
6666
rncore_log("No prebuilt artifacts found, reverting to building from source.")
6767
end
6868
rncore_log("Building from source: #{@@build_from_source}")
69-
rncore_log("Source: #{self.resolve_podspec_source()}")
7069
end
7170
end
7271

@@ -89,7 +88,6 @@ def self.resolve_podspec_source()
8988

9089
if ENV["RCT_USE_PREBUILT_RNCORE"] == "1"
9190
if @@use_nightly
92-
rncore_log("Using nightly tarball")
9391
begin
9492
return self.podspec_source_download_prebuilt_nightly_tarball(@@react_native_version)
9593
rescue => e
@@ -210,14 +208,14 @@ def self.rncore_log(message, level = :info)
210208
if !Object.const_defined?("Pod::UI")
211209
return
212210
end
213-
log_message = '[ReactNativeCore] ' + message
211+
log_message = '[ReactNativeCore] '
214212
case level
215213
when :info
216-
Pod::UI.puts log_message.green
214+
Pod::UI.puts log_message.green + message
217215
when :error
218-
Pod::UI.puts log_message.red
216+
Pod::UI.puts log_message.red + message
219217
else
220-
Pod::UI.puts log_message.yellow
218+
Pod::UI.puts log_message.yellow + message
221219
end
222220
end
223221

packages/react-native/scripts/cocoapods/rndependencies.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def self.resolve_podspec_source()
7575

7676
if ENV["RCT_USE_RN_DEP"] && ENV["RCT_USE_RN_DEP"] == "1"
7777
if @@use_nightly
78-
rndeps_log("Using nightly tarball")
7978
begin
8079
return self.podspec_source_download_prebuilt_nightly_tarball(@@react_native_version)
8180
rescue => e
@@ -84,7 +83,6 @@ def self.resolve_podspec_source()
8483
end
8584
end
8685

87-
rndeps_log("Using release tarball")
8886
begin
8987
return self.podspec_source_download_prebuild_release_tarball()
9088
rescue => e
@@ -204,7 +202,6 @@ def self.download_stable_rndeps(react_native_path, version, configuration)
204202

205203
def self.podspec_source_download_prebuilt_nightly_tarball(version)
206204
url = nightly_tarball_url(version)
207-
rndeps_log("Using nightly tarball from URL: #{url}")
208205
return {:http => url}
209206
end
210207

@@ -245,14 +242,13 @@ def self.rndeps_log(message, level = :info)
245242
if !Object.const_defined?("Pod::UI")
246243
return
247244
end
248-
log_message = '[ReactNativeDependencies] ' + message
249245
case level
250246
when :info
251-
Pod::UI.puts log_message.green
247+
Pod::UI.puts '[ReactNativeDependencies] '.green + message
252248
when :error
253-
Pod::UI.puts log_message.red
249+
Pod::UI.puts '[ReactNativeDependencies] '.red + message
254250
else
255-
Pod::UI.puts log_message.yellow
251+
Pod::UI.puts '[ReactNativeDependencies] '.yellow + message
256252
end
257253
end
258254

0 commit comments

Comments
 (0)