Project: titanium
Issue TIMOB-23237: Windows: Inconsistencies in Ti.API.log
h5.Description *This is not a regression* When using Ti.API.log there are some inconsistencies with other platforms. Firstly, by default it appears that it will log at the debug level when the specified log level is not recognised rather than info, with the log message prefixed with the unrecognised string Also it appears that any logging performed using Ti.API.log will always take on the log level of the last statement, so if I log Ti.API.error('log') and then Ti.API.log('info, 'log') the Ti.API.log statement will be printed out at the error logging level. See below for an example {code} Ti.API.log('meh','I am default log'); Ti.API.error('logging to change other Ti.API.log statements'); Ti.API.log('error','I am error from log'); Ti.API.log('debug', 'I am debug from log'); Ti.API.log('info', 'I am info from log'); Ti.API.log('trace', 'I am trace from log'); Ti.API.log('warn', 'I am warn from log'); {code} {code: title=Logging on Windows Platform} [DEBUG] I am default log [ERROR] logging to change other Ti.API.log statements [ERROR] I am error from log [ERROR] I am debug from log [ERROR] I am info from log [ERROR] I am trace from log [ERROR] I am warn from log {code} {code: title=Logging on Android} [INFO] [meh] I am default log [ERROR] logging to change other Ti.API.log statements [ERROR] I am error from log [INFO] I am info from log [WARN] I am warn from log {code} h5.Steps to reproduce 1. Using the code above build to a Windows emulator using {{appc run -p windows -T wp-emulator}} (This also happens with wp-device and ws-local) h5.Actual result # All logging takes place at the DEBUG level by default # A log can change the log level for logs that follow it # An unrecognised level is not logged as [INFO] [level] h5.Expected result #The logging should take place at the level specified in the code # An unrecognised level should be logged as [INFO] [level] # A log should not be able to change the log level of logs that follow it
Story points: 5