{"id":18509430,"url":"https://github.com/zschuessler/sketch-plugin-log","last_synced_at":"2025-06-12T20:33:11.744Z","repository":{"id":57362329,"uuid":"84229544","full_name":"zschuessler/sketch-plugin-log","owner":"zschuessler","description":"A utility class for managing output to the Mac system log from your Sketch plugin.","archived":false,"fork":false,"pushed_at":"2017-03-18T19:14:50.000Z","size":8,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T20:32:10.307Z","etag":null,"topics":["sketch","sketch-app","sketch-plugin","sketchapp"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/zschuessler.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":"2017-03-07T17:52:36.000Z","updated_at":"2023-09-08T15:29:03.000Z","dependencies_parsed_at":"2022-09-13T21:11:02.834Z","dependency_job_id":null,"html_url":"https://github.com/zschuessler/sketch-plugin-log","commit_stats":null,"previous_names":["sketch-plugin-development/sketch-plugin-log"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zschuessler/sketch-plugin-log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zschuessler%2Fsketch-plugin-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zschuessler%2Fsketch-plugin-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zschuessler%2Fsketch-plugin-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zschuessler%2Fsketch-plugin-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zschuessler","download_url":"https://codeload.github.com/zschuessler/sketch-plugin-log/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zschuessler%2Fsketch-plugin-log/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259522450,"owners_count":22870469,"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":["sketch","sketch-app","sketch-plugin","sketchapp"],"created_at":"2024-11-06T15:17:37.403Z","updated_at":"2025-06-12T20:33:11.400Z","avatar_url":"https://github.com/zschuessler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Sketch Plugin Log\n\nA utility class for managing output to the Mac system log from your Sketch plugin.\n\n## Install\n\nInstall it with `npm`, somewhere within your Sketch plugin folder.\n\n```\nnpm install sketch-plugin-log\n```\n\n## Usage\n\nImport it into your Sketch plugin. Note the import path is relative to the running script!\n\n\n##### ~/MyPlugin.sketchplugin/Contents/Sketch/app.cocoascript\n```javascript\n@import '../node_modules/sketch-plugin-log/index.js';\n\nfunction onRun(context) {\n    // Instantiate\n    var logger = new SketchPluginLog();\n    \n    /**\n     *  Set the Sketch context - required.\n     *  Set the log prefix - optional.\n     */\n     logger\n          .setContext(context)\n          .setLogPrefix('MyPluginName');\n            \n      // Use it. See result in the Console app\n      logger.log('Hello there!');\n      \n      // Dump a CocoaScript object. See result in the Console app.\n      var myCocoaScriptObject = WebView.new();\n      logger.log(myCocoaScriptObject);\n      \n      // Dump an object to a debug file.\n      // Great for when Console app doesn't show all information.\n      // Set the debug file path with `setDebugLogPath` or defaults to {Your plugin root}/Sketch/debug/debug.log\n      logger.debugObject(myCocoaScriptObject);\n}\n\n```\n\n### Viewing Logs\n\nSee the tutorial below for becoming familiar with the Console app:\n\nhttp://www.macworld.com/article/3102847/macs/hands-on-with-macos-sierras-console-now-its-easier-to-get-the-mac-information-you-need.html\n\nConsider saving a custom search for \"Message:MyPluginName\". The \"MyPluginName\" is the log prefix set in the example.\nFiltering based on this identifier leaves you with a clean look at all system logs, which only pertain to your plugin.\n\n\n## Roadmap / About\n\nThis library is a utility part of an upcoming book. Follow this repo for more information on release.\n\nAdditional features will be added for debugging in Sketch:\n\n1. More intuitive display of CocoaScript objects with `debugObject`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzschuessler%2Fsketch-plugin-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzschuessler%2Fsketch-plugin-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzschuessler%2Fsketch-plugin-log/lists"}