{"id":25166016,"url":"https://github.com/thebarbican19/gdlogger","last_synced_at":"2025-12-12T06:10:29.520Z","repository":{"id":30792544,"uuid":"34349561","full_name":"thebarbican19/GDLogger","owner":"thebarbican19","description":null,"archived":false,"fork":false,"pushed_at":"2017-06-15T13:59:56.000Z","size":29,"stargazers_count":12,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-25T06:18:48.678Z","etag":null,"topics":["logging","objective-c"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thebarbican19.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-21T20:07:07.000Z","updated_at":"2022-01-08T20:22:15.000Z","dependencies_parsed_at":"2022-08-20T20:20:47.867Z","dependency_job_id":null,"html_url":"https://github.com/thebarbican19/GDLogger","commit_stats":null,"previous_names":["northernspark/gdlogger"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebarbican19%2FGDLogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebarbican19%2FGDLogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebarbican19%2FGDLogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebarbican19%2FGDLogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thebarbican19","download_url":"https://codeload.github.com/thebarbican19/GDLogger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251781950,"owners_count":21642975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logging","objective-c"],"created_at":"2025-02-09T05:47:30.160Z","updated_at":"2025-12-12T06:10:29.467Z","avatar_url":"https://github.com/thebarbican19.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GDLogger\n\u003cstrong\u003eGDLogger\u003c/strong\u003e is a lightweight class logging class for iOS versions 3.0 and above, build for \u003ca href=\"http://gradoapp.com\"\u003eGrado\u003c/a\u003e. It allows for quick, strightforward creation, and appending of multiple, formatted log files.\u003cp\u003e\n\n\u003ch3\u003eSetup\u003c/h3\u003e\nWe now support CocoaPod's \u003ccode\u003epod 'GDLogger'\u003c/code\u003e\u003cp\u003e\n\nAdd \u003ccode\u003e#import \"GDLogger/GDLogger.h\"\u003c/code\u003e\n\u003cbr/\u003e\nIn your .m file add \u003ccode\u003eGDLogger *logger = [[GDLogger alloc] init];\u003c/code\u003e\n\n\u003ch3\u003eDebugging\u003c/h3\u003e\nto enable console debugging simply set \u003ccode\u003elogger.degbugger = true;\u003c/code\u003e\u003cp\u003e\n\u003cp\u003e\n\t\n\u003ch3\u003eMutiple Logs\u003c/h3\u003e\nWe recently updated \u003cstrong\u003eGDLogger\u003c/strong\u003e to support multiple log files. By default there will be only one log file saved locally \u003cstrong\u003e\"[YourApp]-logger.txt\"\u003c/strong\u003e. This is created when you log your first event. To create a new log file simply set the filename. \u003cp\u003e\n\u003cp\u003e\n\u003ccode\u003elogger.filename = @\"my-new-log\";\u003c/code\u003e\n\u003cp\u003e\n\u003cstrong\u003eNOTE\u003c/strong\u003e To revert back to the default log file set \u003ccode\u003elogger.filename = nil;\u003c/code\u003e\u003c/br\u003e\n\u003cstrong\u003eNOTE\u003c/strong\u003e Do not include the file type when setting \u003ccode\u003elogger.filename\u003c/code\u003e\u003c/br\u003e\n\n\u003cp\u003e\n\n\u003ch3\u003e\"Events\"\u003c/h3\u003e\nEvents are what are created every time you create a new item in GDLogger. They contain 2 objects, a \"title\" and \"properties\"\u003cp\u003e\n\u003cstrong\u003etitle\u003c/strong\u003e (NSString\u003cbr/\u003e\n\u003cstrong\u003eproperties\u003c/strong\u003e (NSDictionary)\u003cp\u003e\n\u003ccode\u003e[logger log:@\"Event Title\" properties:@{@\"key\":@\"value\", @\"installed\":[NSNumber numberWithBool:true]}];\u003c/code\u003e\n\n\u003ch3\u003ePrint\u003c/h3\u003e\nTo print out the entire log file as a \u003cstrong\u003eNSString\u003c/strong\u003e use \u003ccode\u003elogger.logPrint\u003c/code\u003e\u003cp\u003e\n\u003cp\u003e\nAlternatively, you can get the file content as \u003cstrong\u003eNSData\u003c/strong\u003e \u003ccode\u003elogger.logData\u003c/code\u003e\u003cp\u003e\n\u003cstrong\u003eNOTE\u003c/strong\u003e this will print out the default log file unless \u003ccode\u003elogger.filename\u003c/code\u003e has been set\n\u003cp\u003e\t\n\t\n\u003ch3\u003eFiles\u003c/h3\u003e\nThere is two ways of getting access to the saved files.\n\u003cbr/\u003e\nYou can get the active most recent file by calling \u003ccode\u003elogger.logPrint\u003c/code\u003e\n\u003cp\u003e\n\t\nOr, you can get an array of \u003cstrong\u003eall\u003c/strong\u003e files by calling\n\n\u003ccode\u003e[self.logger logFiles:true]\u003c/code\u003e (This will return the all the files with their full directories as \u003cstrong\u003eNSURL\u003c/strong\u003e)\u003cbr/\u003e\n\u003ccode\u003e[self.logger logFiles:false]\u003c/code\u003e (This will return the all the files with just their respective file names as \u003cstrong\u003eNSString\u003c/strong\u003e)\n\u003cp\u003e\n\t\n\u003ch3\u003eRemove/Destory\u003c/h3\u003e\nCalling \u003ccode\u003e[self logDestory];\u003c/code\u003e will destory the active log file. \n\u003cp\u003e\n\t\n\u003ch3\u003eShare\u003c/h3\u003e\nThere will be many ways you will choose to utilize the saved data. Sending it as an attachment is the most common so we have added an example for you lazy folk out there\n\n\u003cpre\u003e\nMFMailComposeViewController *emailController = [[MFMailComposeViewController alloc] init];\n[emailController setMailComposeDelegate:self];\n[emailController setToRecipients:[[NSArray alloc] initWithObjects:@\"email@gmail.com\", nil]];\n[emailController setSubject:@\"Log File\"];\n[emailController setMessageBody:@\"\" isHTML:false];\n[emailController addAttachmentData:[logger logData] mimeType:@\"text/plain\" fileName:@\"logger.txt\"];\n[emailController setModalTransitionStyle:UIModalTransitionStyleCoverVertical];\n[self presentViewController:emailController animated:true completion:nil];\u003c/pre\u003e\n        \n\u003cp\u003e\u003cstrong\u003eNOTE\u003c/strong\u003e the fileName for addAttachmentData can be anything\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebarbican19%2Fgdlogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthebarbican19%2Fgdlogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebarbican19%2Fgdlogger/lists"}