{"id":14956577,"url":"https://github.com/mongodb/grip","last_synced_at":"2025-11-11T21:02:52.225Z","repository":{"id":34152524,"uuid":"37991233","full_name":"mongodb/grip","owner":"mongodb","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-25T16:25:27.000Z","size":6153,"stargazers_count":16,"open_issues_count":13,"forks_count":22,"subscribers_count":106,"default_branch":"main","last_synced_at":"2025-10-18T07:58:25.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mongodb.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-06-24T14:55:31.000Z","updated_at":"2025-06-25T16:25:32.000Z","dependencies_parsed_at":"2024-06-18T17:06:37.181Z","dependency_job_id":"6ada272d-3d04-4352-9905-0ff239744344","html_url":"https://github.com/mongodb/grip","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mongodb/grip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb%2Fgrip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb%2Fgrip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb%2Fgrip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb%2Fgrip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mongodb","download_url":"https://codeload.github.com/mongodb/grip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb%2Fgrip/sbom","scorecard":{"id":658468,"data":{"date":"2025-08-11","repo":{"name":"github.com/mongodb/grip","commit":"b6db77cf60c463b191a612557885b675254e039a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":9,"reason":"Found 22/24 approved changesets -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"15 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2024-2453 / GHSA-9763-4f94-gfch","Warn: Project is vulnerable to: GO-2025-3754 / GHSA-2x5j-vhc8-9cwm","Warn: Project is vulnerable to: GO-2023-2113 / GHSA-rcjv-mgp8-qvmr","Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2025-3488 / GHSA-6v2p-p543-phr9","Warn: Project is vulnerable to: GO-2024-2611 / GHSA-8r3f-844c-mc37"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T15:22:07.599Z","repository_id":34152524,"created_at":"2025-08-21T15:22:07.606Z","updated_at":"2025-08-21T15:22:07.606Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283929675,"owners_count":26918166,"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","status":"online","status_checked_at":"2025-11-11T02:00:06.610Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-09-24T13:13:09.822Z","updated_at":"2025-11-11T21:02:52.181Z","avatar_url":"https://github.com/mongodb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"=======================================================\n``grip`` -- A Go Library for Logging and Error Handling\n=======================================================\n\n``grip`` isn't any thing special, but it does a few pretty great\nthings:\n\n#. Provide a common logging interface with support for multiple\n   logging backends including syslog, systemd's journal, slack, xmpp,\n   a JSON logging system, and others.\n\n#. Provides some simple methods for handling errors, particularly when\n   you want to accumulate and then return errors.\n\n#. Provides tools for collecting structured logging information.\n\n*You just get a grip, folks.*\n\nUse\n---\n\nDownload:\n\n::\n\n   go get -u github.com/mongodb/grip\n\nImport:\n\n::\n\n   import \"github.com/mongodb/grip\"\n\nComponents\n----------\n\nOutput Formats\n~~~~~~~~~~~~~~\n\nGrip supports a number of different logging output backends:\n\n- systemd's journal (linux-only)\n- syslog (unix-only)\n- writing messages to standard output. (default)\n- writing messages to a file.\n- sending messages to a slack's channel\n- sending messages to a user via XMPP (jabber.)\n\nThe default logger interface has methods to switch the backend to\nthe standard output (native; default), and file-based loggers. The\nSetSender() and CloneSender() methods allow to replace the sender\nimplementation in your logger.\n\nSee the documentation of the `Sender interface\n\u003chttps://godoc.org/github.com/mongodb/grip/send#Sender\u003e`_ for more\ninformation on building new senders.\n\nLogging\n~~~~~~~\n\nProvides a fully featured level-based logging system with multiple\nbackends (e.g. send.Sender). By default logging messages are printed\nto standard output, but backends exists for many possible targets. The\ninterface for logging is provided by the Journaler interface.\n\nBy default ``grip.std`` defines a standard global  instances\nthat you can use with a set of ``grip.\u003cLevel\u003e`` functions, or you can\ncreate your own ``Journaler`` instance and embed it in your own\nstructures and packages.\n\nDefined helpers exist for the following levels/actions:\n\n- ``Debug``\n- ``Info``\n- ``Notice``\n- ``Warning``\n- ``Error``\n- ``Critical``\n- ``Alert``\n- ``Emergency``\n- ``EmergencyPanic``\n- ``EmergencyFatal``\n\nHelpers ending with ``Panic`` call ``panic()`` after logging the message\nmessage, and helpers ending with ``Fatal`` call ``os.Exit(1)`` after\nlogging the message. These are primarily for handling errors in your\nmain() function and should be used sparingly, if at all, elsewhere.\n\n``Journaler`` instances have a notion of \"default\" log levels and\nthresholds, which provide the basis for verbosity control and sane\ndefault behavior. The default level defines the priority/level of any\nmessage with an invalid priority specified. The threshold level,\ndefines the minimum priority or level that ``grip`` sends to the\nlogging system. It's not possible to suppress the highest log level,\n``Emergency`` messages will always log.\n\n``Journaler`` objects have the following, additional methods (also\navailable as functions in the ``grip`` package to manage the global\nstandard logger instance.):\n\n- ``SetName(\u003cstring\u003e)`` to reset the name of the logger. ``grip``\n  attempts to set this to the name of your program for the standard\n  logger.\n\n- ``SetDefault(\u003clevel int\u003e)`` change the default log level. Levels are\n  values between ``0`` and ``7``, where lower numbers are *more*\n  severe. ``grip`` does *not* forbid configurations where default\n  levels are *below* the configured threshold.\n\n- ``SetThreshold(\u003clevel int\u003e)`` Change the lowest log level that the\n  ``grip`` will transmit to the logging mechanism (either ``systemd``\n  ``journald`` or Go's standard logging.) Log messages with lower\n  levels are not captured and ignored.\n\nThe ``Journaler.InvertFallback`` flag (bool) switches a ``Journaler``\ninstance to prefer the standard logging mechanism rather than\n``systemd``.\n\nBy default:\n\n- the log level uses the \"Notice\" level (``5``)\n\n- the minimum threshold for logging is the \"Info\" level (``6``)\n  (suppressing only debug.)\n\n- fallback logging writes to standard output.\n\nCollector for \"Continue on Error\" Semantics\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf you want to do something other than just swallow errors, but don't\nneed to hard abort, the ``MultiCatcher`` object makes this pattern\nswell, a la:\n\n::\n\n   func doStuff(dirname string) (error) {\n           files, err := ioutil.ReadDir(dirname)\n           if err != nil {\n                   // should abort here because we shouldn't continue.\n                   return err\n           }\n\n           catcher := grip.NewCatcher()\n           for _, f := range files {\n               err = doStuffToFile(f.Name())\n               catcher.Add(err)\n           }\n\n           return catcher.Resolve()\n   }\n\n\nSimple Error Catching\n~~~~~~~~~~~~~~~~~~~~~\n\nUse ``grip.Catch(\u003cerr\u003e)`` to check and print error messages.\n\nThere are also helper functions on ``Journaler`` objects that check\nand log error messages using either the default (global) ``Journaler``\ninstance, or as a method on specific ``Journaler`` instances, at all\nlevels:\n\n- ``CatchDebug``\n- ``CatchInfo``\n- ``CatchNotice``\n- ``CatchWarning``\n- ``CatchError``\n- ``CatchCritical``\n- ``CatchAlert``\n- ``CatchEmergency``\n- ``CatchEmergencyPanic``\n- ``CatchEmergencyFatal``\n\nConditional Logging\n~~~~~~~~~~~~~~~~~~~\n\n``grip`` incldues support for conditional logging, so that you can\nonly log a message in certain situations, by adding a Boolean argument\nto the logging call. Use this to implement \"log sometimes\" messages to\nminimize verbosity without complicating the calling code around the\nlogging.\n\nThese methods have a ``\u003cLevel\u003eWhen\u003c\u003e`` format. For\nexample: ``AlertWhen``, ``AlertWhenln``, ``AlertWhenf``.\n\nComposed Logging\n~~~~~~~~~~~~~~~~\n\nIf the production of the log message is resource intensive or\ncomplicated, you may wish to use a \"composed logging,\" which delays\nthe generation of the log message from the logging call site to the\nmessage propagation, to avoid generating the log message unless\nneccessary. Rather than passing the log message as a string, pass the\nlogging function an instance of a type that implements the\n``MessageComposer`` interface: ::\n\n   type MessageComposer interface {\n        String() string\n        Raw() interface{}\n        Loggable() bool\n        Priority() level.Priority\n        SetPriority(level.Priority) error\n   }\n\nComposed logging may be useful for some debugging logging that depends\non additional database, API queries, or data serialization. Composers\nare also the mechanism through which the ``Catch\u003c\u003e`` methods are\nimplemented,\n\nGrip uses composers internally, but you can pass composers directly to\nany of the basic logging method (e.g. ``Info()``, ``Debug()``) for\ncomposed logging.\n\nGrip includes a number of message types, including those that collect\nsystem information, process information, stacktraces, or simple\nuser-specified structured information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongodb%2Fgrip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmongodb%2Fgrip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongodb%2Fgrip/lists"}