npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sf-trace-plugin

v1.0.3

Published

A plugin that allows you to update trace flags in a target salesforce org

Downloads

112

Readme

SF Apex Trace Plugin

This plugin was developed for the Joys Of Apex post Authoring SF CLI Plugins, and it allows you to setup and maintain TraceFlag records for any Salesforce org you're authorized to using the SF CLI.

Installation

It can be installed by running:

echo y | sf plugins install jamessimone/sf-trace-plugin

Or by adding sf-trace-plugin to your unsignedPluginAllowlist.json:

["jamessimone/sf-trace-plugin"]

And then running:

sf plugins install jamessimone/sf-trace-plugin

Or by pointing to the GitHub repository itself during the install command:

sf plugins install https://github.com/jamessimone/sf-trace-plugin

Usage

By default, you can run the plugin without arguments to start a one hour trace for your user in your currently authenticated org:

sf apex trace

Different command line flags allow you to augment this functionality, stipulating a minute or hour time frame:

# sets a 30 minute trace on the Automated Process User
sf apex trace --trace-duration 30m --is-autoproc-trace
# sets a 2 hour trace on another user
sf apex trace --trace-duration 2hr --target-user [email protected]

The API for the allowable flags is delineated below.

Command Line Flags

This plugin currently supports the following flags:

  • --debug-level-name (shortcut -l): if there has never been a USER_DEBUG TraceFlag record for the given user, this optional flag stipulates the DebugLevel DeveloperName to use. Defaults to SFDC_DevConsole, otherwise.
  • --is-autoproc-trace (shortcut -a): if the trace should be set for the Automated Process User. Cannot be used in conjunction with --target-user
  • --trace-duration (shortcut -d): how long you'd like the trace to be active for. Defaults to 1hr and values can be supplied with either minutes (eg 15m) or hours (eg 4hr). Because TraceFlag records can have a max duration of 24 hours, inputting a trace duration of more than that will only set the duration for 24 hours.
  • --target-org (shortcut -o): the name/alias of the org you want to establish the trace on. Defaults to your currently authorized org when run in an SFDX project directory
  • --target-user (shortcut -u): by default, traces are set for the currently authorized user; this flag allows you to override that and supply any valid username in the org to set a trace for. Cannot be used in conjunction with --is-autoproc-trace