Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19077] Windows: Logging does not seem to work when using device

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-07-28T17:32:16.000+0000
Affected Version/sRelease 4.1.0
Fix Version/sRelease 5.0.0
ComponentsWindows
Labelsqe-4.1.0
ReporterEwan Harris
AssigneeKota Iguchi
Created2015-06-26T01:06:21.000+0000
Updated2016-05-06T07:58:35.000+0000

Description

Description

When building to Windows Phone device I am unable to get logging to work. I have tried across multiple machines and devices when using the same wifi etc. Logging works fine when running in an emulator.
var win = Ti.UI.createWindow({backgroundColor: 'red'});

var lbl = Ti.UI.createLabel({
    text: 'I log things!',
     color: 'black'
});

lbl.addEventListener('click', function(){
    Ti.API.info('Hello from info!');
    Ti.API.debug('Hello from debug!');
    Ti.API.error('Hello from error!');
});

win.add(lbl);
win.open();

Steps To Reproduce

1. Add the above code to an app.js and build to device 2. Build to emulator

Actual Result

1. No logging 2. Logging

Expected Result

There should be logging in both circumstances

Comments

  1. Fokke Zandbergen 2015-07-02

    Might require PowerTools to be installed on the device? https://msdn.microsoft.com/en-us/library/windows/apps/dn629255.aspx
  2. Kota Iguchi 2015-07-23

    Started looking into this, hope Microsoft provides kind of helper tools for that.
  3. Kota Iguchi 2015-07-23

    I have confirmed that the logging mechanics itself (windowslib.LogRelay) is working even on device. But it seems it is disabled _on purpose_ when building for device through Titanium CLI during encryption process, which sounds reasonable for me. I think that the fundamental problem is that currently CLI builds Release app only and it doesn't provide target build option (Debug/Release). I think we need to implement the option before TIMOB-19077 because I think logging should be enabled only when it is built with Debug mode. Would you confirm above, dose this sounds reasonable for you guys [~cwilliams] [~dtoth]?
  4. Christopher Williams 2015-07-23

    [~kota] Do you know where it's disabled exactly? I think we are mixing up Debug/Release builds of libs versus deploy type of production/development here. I think turning off logging for production deploy type makes sense, but should be on for development. Debug/Release libs is another issue and is useful for doing actual debugging of the stack in VS. We intentionally don't do Debug libs because of how large the SDK would bloat - and i'm not sure how much end users would need to be able to do debugging of the Titanium internals. It may be useful for _us_ SDK developers - or for module developers.
  5. Christopher Williams 2015-07-23

    Just another note that we can't just do "Debug" build for the user's app because it behaves oddly/crashes when you build the user's app as Debug against Release versions of the SDK libs.
  6. Kota Iguchi 2015-07-24

    Yup I think I mixed up Debug/Release and production/development...Logging should be enabled for development deploy type even on device. Started looking into CLI.
  7. Kota Iguchi 2015-07-24

    https://github.com/appcelerator/titanium_mobile_windows/pull/389
  8. Kota Iguchi 2015-07-24

    I should note that in order to make logging work on device, you should enable wi-fi because your device needs network access to your computer.
  9. Lokesh Choudhary 2015-08-13

    Verified the fix. Logging works on windows device. Closing. Environment: Appc Studio: 4.2.0.201508062204 Ti SDK: 4.2.0.v20150812110420 ( to be rename to 5.0) Ti CLI: 4.1.4 Alloy: 1.6.2 Windows: 8.1 Enterprise 64-bit APPC NPM: 4.2.0-1 APPC CLI: 4.2.0-44 Node : v0.10.37 Device: Nokia Lumia 928 - Windows Phone 8.1 Windows emulator : 8.1
  10. Jörgen Buder 2016-04-26

    Should we reopen this, or how did you exactly get that working? I cannot see any logs from device when I am running the app? Thanks
  11. Kota Iguchi 2016-04-26

    [~buder] I guess you mean logging from native logs? We have a ticket for it: TIMOB-23241
  12. Kota Iguchi 2016-04-26

    -native logs- -> native modules ;)
  13. Jörgen Buder 2016-04-26

    Hi Kota No I do not mean from module, from module is not working yet for me and I will have a look at the ticket BUT I have never been able to collect logs from the device to the console in Studio or cmd You have a ticket on this from way before but I cannot tell if this was resolved or not.. The basic thing is, there are no logs from device, any Ti.API.info is not output to the cmd our output console At some point you have said that you are not able to do that from phone device unless you build in debug on device and that is not possible (why?) Not being able to see the legs on phone device is a HUGE problem from a development perspective. As in this very now I am trying to understand why I am getting a crash on the phone but I have no logs what so ever to investigate the problem.. Do you have a solution to this, in that case I need it now... I have not been able to do this ever, not since I started with Win phone dev in TI summer 2015 :(
  14. Jörgen Buder 2016-04-26

    And is that ticket on the way into the latest builds? I mean the module loggs? I can find a pull but no win 8.1 builds...
  15. Kota Iguchi 2016-04-26

    I have tried 5.2, 5.3 and 5.4 builds and device logging worked for all of them. (not so latest build, tested on 5.4.0.v20160421173335, 5.3.0.v20160415121959 and 5.2.3.v20160404160237). [~buder] Do you enable wi-fi access on your device? Can the device access to your PC through wi-fi? In order to make logging work, your device and PC need wi-fi connection because Ti CLI establishes connection between device and PC to communicate messages.
  16. Jörgen Buder 2016-04-26

    Ok, so I have always been running latest from nightly builds, are you saying that the logging do not work on the latest builds? In that case that is one reason, then I have to recheck the wifi but yes I believe I do have them on same wifi, I will try with one of the stable versions you mention and get back to you..
  17. Jörgen Buder 2016-04-26

    and we are both talking about Windows phone device here ??
  18. Jörgen Buder 2016-04-26

    and when you say same "wifi" you mean same network? Not necessarily wifi.. can be one wifi (phone) and one cable or wifi on the host
  19. Kota Iguchi 2016-04-26

    {quote} Ok, so I have always been running latest from nightly builds, are you saying that the logging do not work on the latest builds? {quote} No, I'm not saying that. I said I tested 5.2, 5.3 and 5.4 and logging worked for all of them. On the device. Windows Phone 8.1. {quote} and when you say same "wifi" you mean same network? {quote} Yes, it should be on the same network because {quote} Ti CLI establishes connection between device and PC to communicate messages. {quote} PS I have tested on the very latest 5.4 (5.4.0.v20160426000033) and logging worked too.
  20. Jörgen Buder 2016-04-26

    I have been running that exact same latest build on my device here 1 hours ago and I get nothing. :( There must be something more needed than same network :( Is there any more settings needed in the phone? Do note that I run the app on the phone fine, but no loggs.. /Jörgen
  21. Jörgen Buder 2016-04-26

    Are you running a dedicated window host or are you running Parallels? I checked my parallels network and I have perfect network connection so there is nothing stopping it, I have also disabled all firewall settings... I have access to the network
  22. Kota Iguchi 2016-04-26

    I'm running a dedicated window host. I see, it sounds it's related to TIMOB-23260. Maybe there's something to do with Parallels...
  23. Jörgen Buder 2016-04-28

    I do not think that is related... :)
  24. Kota Iguchi 2016-05-06

    Just got Parallels for me and I was able to make it work by enabling "*Wi-Fi*" in Parallels preference. See comments in TIMOB-23260 for details.

JSON Source