AssetBundleCompiler icon indicating copy to clipboard operation
AssetBundleCompiler copied to clipboard

Never get unity logs

Open RobinHSanner opened this issue 7 years ago • 7 comments

The code: .withUnityLogger(message => { log.debug(Unity: ${message}); console.log(Unity: ${message}); }) never gets hit. When unity does have a problem the error is always: {"unityLog":""}

Lately for no apparent reason i'm getting the error that says unity crashed and the log file it says it created is always empty.

RobinHSanner avatar Feb 01 '18 22:02 RobinHSanner

The problem can be simulated by using the erroneous: .withBuildOptions({ strict: true }) - should be strictMode.

In unity_invoker.js if I modify the function toArgv with:

    else if (key === 'logFile') {
        argv.push('c:\\temp\\unity.log');
    }

then I get a log. by default the logFile property is set to true and so nothing gets pushed after it but according to https://docs.unity3d.com/Manual/CommandLineArguments.html -logFile needs a filename after it.

RobinHSanner avatar Feb 01 '18 23:02 RobinHSanner

Hello @RobinHSanner, thanks for the report!

What version of Unity do you use? I suspect 2017.x since this used to work before.

Yes, -logFile without argument seems counter-intuitive, but this is how you were specifying to Unity to not use a log file and send back the log in real time to stdout. Then we we were watching stdout and writing our own log file in case of problem.

I will check if the behaviour has effectively changed in Unity 2017, try to reproduce and fix the problem (implementing a different behaviour based on the version of Unity) and I'll keep you informed.

toverux avatar Feb 02 '18 07:02 toverux

Hello again,

I can't reproduce with Unity 5.x, nor with Unity 2017.x.

Also, what's your OS? Compatibility with Windows is mostly untested, and I wouldn't be surprised if this specific point about logfile/stdout has a different behaviour on Windows.

toverux avatar Feb 02 '18 08:02 toverux

Unity 2017.3.0f3 Windows 10

RobinHSanner avatar Feb 02 '18 17:02 RobinHSanner

Okay, must be a Windows-specific problem.

(@fklingler @CrazyTales Wanna fix Windows-ish things?)

toverux avatar Feb 02 '18 17:02 toverux

Unity 2017.3.0f3

From: Morgan Touverey-Quilling [mailto:[email protected]] Sent: Friday, February 2, 2018 03:43 To: mitmadness/AssetBundleCompiler [email protected] Cc: Robin Sanner [email protected]; Mention [email protected] Subject: Re: [mitmadness/AssetBundleCompiler] Never get unity logs (#3)

Hello again,

I can't reproduce with Unity 5.x, nor with Unity 2017.x.

Also, what's your OS? Compatibility with Windows is mostly untested, and I wouldn't be surprised if this specific point about logfile/stdout has a different behaviour on Windows.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/mitmadness/AssetBundleCompiler/issues/3#issuecomment-362522024, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AI25k6bC5pUqhivUkEduEJUyUKEXLzuxks5tQsp1gaJpZM4R2XDH.

RobinHSanner avatar Feb 02 '18 18:02 RobinHSanner

So that's a problem on Windows indeed: https://answers.unity.com/questions/19566/command-line-feedback.html One of our teammate on Win had the same problem as you. Unless someone proposes a workaround it'll stay a wontfix, better wait a proper fix from Unity.

toverux avatar Sep 13 '18 09:09 toverux