-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change(mac): adopt unified logging APIs #11515
Conversation
delete commented out code and unimplemented method
KMLogs creates singleton os_log objects with the subsystem and categories shared throughout the application
first draft, need to remove some debug statements and replace others that would be more useful
remove logDebugMessage API which calls NSLog and call os_log instead
remove all references to NSLog adjust log level for some calls to os_log Fixes #10997
User Test ResultsTest specification and instructions User tests are not required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nits only, LGTM.
I think we should use com.keyman
and not org.sil.keyman
as our namespace -- we have keyman.com
as a domain but not keyman.sil.org
(if we went that way it probably should be org.sil.software.keyman
).
I also added .app
and .engine
so that com.keyman
was grouping namespace, with submodules beneath that.
mac/Keyman4MacIM/Keyman4MacIM/main.m
Outdated
|
||
const NSString *kConnectionName = @"Keyman_Input_Connection"; | ||
IMKServer *server; | ||
|
||
int main(int argc, const char * argv[]) { | ||
NSString *identifier; | ||
os_log_t configLog = os_log_create("org.sil.keyman", "startup"); | ||
NSString *identifier; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NSString *identifier; | |
NSString *identifier; |
NSData* data = [self.textToInsert dataUsingEncoding:NSUTF16LittleEndianStringEncoding]; | ||
|
||
return [[NSString alloc] initWithFormat: @"codePointsToDeleteBeforeInsert: %li, textToInsert: '%@', optionsToPersist: %@, alert: %d, emitKeystroke: %d, capsLockState: %d ", self.codePointsToDeleteBeforeInsert, data, self.optionsToPersist, self.alert, self.emitKeystroke, self.capsLockState]; | ||
NSData* deleteData = [self.textToDelete dataUsingEncoding:NSUTF16LittleEndianStringEncoding]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this is a change in behaviour -- just checking that self.textToDelete is never null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description method is called to log the CoreKeyOutput state from CoreWrapper processMacVirtualKey. Both textToInsert
and textToDelete
can be null, but if they are, then dataUsingEncoding
returns null, and the log statement will say textToDelete: '(null)' [data: '(null)']
Because this is being logged with a debug statement, this description method will only be executed when the user is streaming debug logs.
|
||
@implementation KMELogs | ||
|
||
char *const keymanEngineSubsystem = "org.sil.keymanengine"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
char *const keymanEngineSubsystem = "org.sil.keymanengine"; | |
char *const keymanEngineSubsystem = "com.keyman.engine"; |
|
||
@implementation KMLogs | ||
|
||
char *const keymanSubsystem = "org.sil.keyman"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
char *const keymanSubsystem = "org.sil.keyman"; | |
char *const keymanSubsystem = "com.keyman.app"; |
@@ -21,7 +22,7 @@ - (id)initWithFilePath:(NSString *)path { | |||
|
|||
NSFileHandle *file = [NSFileHandle fileHandleForReadingAtPath:path]; | |||
if (file == nil) { | |||
//NSLog(@"Failed to open kvk file"); | |||
os_log_error([KMELogs configLog], "Failed to open kmx file"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os_log_error([KMELogs configLog], "Failed to open kmx file"); | |
os_log_error([KMELogs configLog], "Failed to open kvk file"); |
address review comments
Changes in this pull request will be available for download in Keyman version 18.0.45-alpha |
6 similar comments
Changes in this pull request will be available for download in Keyman version 18.0.45-alpha |
Changes in this pull request will be available for download in Keyman version 18.0.45-alpha |
Changes in this pull request will be available for download in Keyman version 18.0.45-alpha |
Changes in this pull request will be available for download in Keyman version 18.0.45-alpha |
Changes in this pull request will be available for download in Keyman version 18.0.45-alpha |
Changes in this pull request will be available for download in Keyman version 18.0.45-alpha |
os_log_t
objects to identify different parts of the application for logging purposesos_log
,os_log_error
,os_log_info
andos_log_debug
to record log statements.logDebugMessage
and theNSLog
macro, as they do not use unified logging (and do not specify subsystem and category)Fixes #10997
@keymanapp-test-bot skip