Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11618] Android: Ti.API.log: function calls with one arg (log level) do not print as the correct log level, and have some format problems

GitHub Issuen/a
TypeSub-task
PriorityLow
StatusClosed
ResolutionDuplicate
Resolution Date2012-10-31T18:29:44.000+0000
Affected Version/sRelease 2.1.3, Release 3.0.0
Fix Version/sn/a
ComponentsAndroid
Labelsparity, qe-and100112
ReporterDustin Hyde
AssigneeIngo Muschenetz
Created2012-10-31T00:10:17.000+0000
Updated2017-03-17T18:57:51.000+0000

Description

Ti.API.log console logging calls with one arg (log level) do not print as the correct log level. They all default to [INFO] instead. This does not occur in MobileWeb. This is a parity issue. This is also an inconsistency within the Android platform because log calls with two args work as expected. Notice the two edge-cases as well with Ti.API.log() with no arg printing as [undefined] when it would normally be expected to be the null string, and Ti.API.log('log') with a freeform log type does not contain brackets when it normally would (see expected results for both). Steps to Reproduce: 1. Run code:
Ti.API.log();
Ti.API.log('trace');
Ti.API.log('debug');
Ti.API.log('info');
Ti.API.log('warn');
Ti.API.log('error');
Ti.API.log('log');
Actual Result:
[INFO][TiAPI   (  327)] [undefined] 
[INFO][TiAPI   (  327)] trace
[INFO][TiAPI   (  327)] debug
[INFO][TiAPI   (  327)] info
[INFO][TiAPI   (  327)] warn
[INFO][TiAPI   (  327)] error
[INFO][TiAPI   (  327)] log
Expected Result:
[INFO][TiAPI   (  327)]
[TRACE][TiAPI   (  327)] trace
[DEBUG][TiAPI   (  327)] debug
[INFO][TiAPI   (  327)] info
[WARN][TiAPI   (  327)] warn
[ERROR][TiAPI   (  327)] error
[INFO][TiAPI   (  327)] [log]

Comments

  1. Dustin Hyde 2012-10-31

    This occurs in iOS as well in TIMOB-11615 (with slight variations).
  2. Dustin Hyde 2012-10-31

    Duplicate of TIMOB-11615.
  3. Dustin Hyde 2012-10-31

    Need to revisit [undefined] log message edge case within this ticket.
  4. Lee Morris 2017-03-17

    Closing ticket as duplicate.

JSON Source