googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.25k stars 343 forks source link

unity batchmode logFile, log redirect system output #226

Closed yingnierxiao closed 5 years ago

yingnierxiao commented 5 years ago

on ios build

$UNITY_PATH -batchmode -projectPath $PROJECT_PATH -logFile ${TEMP_LOG_PATH} -executeMethod ProjectBuilder.BuildForAndroid -quit project-"${OUTPUT_PROJECT_PATH}/${PACKAGE_NAME}"${TEMP_PROJECT_ARGS} log master write to TEMP_LOG_PATH,but now log redirect to system output

https://github.com/googlesamples/unity-jar-resolver/blob/b97a80b3e4b190000ef14cf771c0d64899e1a005/source/PlayServicesResolver/src/CommandLine.cs#L539

stewartmiles commented 5 years ago

@yingnierxiao what is the issue here? The CommandLine class launches another process. If stdoutRedirectionInShellMode is true and the other process is launched via the system shell, the output of the process is redirected. The code you've pointed at shouldn't change where the Unity Editor process writes its' logs.

yingnierxiao commented 5 years ago

i down the code,change stdoutRedirectionInShellMode is false,No effect。I think there are other problems. But if I remove this library, there's no problem

yingnierxiao commented 5 years ago

if args has logfile not need System.Environment.CommandLine.Contains("-batchmode") || source/VersionHandlerImpl/src/VersionHandlerImpl.cs ///

/// Enable / disable verbose logging. /// public static bool VerboseLoggingEnabled { get { return //System.Environment.CommandLine.Contains("-batchmode") || settings.GetBool(PREFERENCE_VERBOSE_LOGGING_ENABLED, defaultValue: false); } set { settings.SetBool(PREFERENCE_VERBOSE_LOGGING_ENABLED, value); } }