Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@yawnxyz/sheetlog
Advanced tools
Sheet log is a simple console.log-like logger — think Sentry — to Google Sheets with a modified SpreadAPI script.
This is ideal for projects and prototypes where Sentry is too heavy, and you just want a semi-public log dump. Google Sheets is great because they have filtering, formulas, graphing, and more stuff built in.
Google Sheets supports up to roughly 200,000 cells per sheet (I think)
sheet.setup({sheetUrl: "some url"})
sheet.log({some: "data"})
to your code, and it'll log to the Logs
sheet!By default, sheet.log({some: "data"})
logs to a tab named "Logs". You can add more sheets/tabs to your Google Sheet with passing in {sheet: "sheetName"}
.
You can also define a sqid based on a custom number sequence, by passing in {sqid: [1,2,3]}
. Remember that sqids can always be reversed to the original sequence.
sheet.log({some: "data}, {
sheet: "sheetName", // custom sheet name
sqid: [new Date().getTime(), userId, postId, commentId] // example of adding more items into a sqid for referencing
})
You can also change some of the default settings by doing:
let customSheet = sheet.setup({
SHEET_URL: "some custom sheet url",
logPayload: false, // log the payload back to console?
concurrency: 5, // async-sema concurrency; can go up to 5
useSqid: false, // creates a sqid based on timestamp for easy referencing
})
Here's two ways to use sheet.log:
import sheet, { Sheet } from './index.mjs';
// sheet.setup({ sheetUrl: "123" });
sheet.log({ a: 1, b: 2 });
const customSheet = new Sheet();
customSheet.setup({
// SHEET_URL: "https://example.com",
logPayload: false, // log the payload back to console?
concurrency: 5, // async-sema concurrency; can go up to 5
useSqid: false, // creates a sqid based on timestamp for easy referencing
})
customSheet.log({ custom: true });
async-sema
is used to throttle requests to Google Sheets; more than 5 requests at a time makes Sheets sadsqids
is used to create short IDs based on request time to quickly identify/search for batches of data in lengthy, inscrutable logsMany thanks to SpreadAPI for sharing the code for free (and even letting everyone know you CAN do this at all, without any expensive third party tools or the official API!). All credit goes to them.
Also many thanks to GPT-4 for helping me add the custom modes to SpreadAPI :P
FAQs
a google sheets logging system
The npm package @yawnxyz/sheetlog receives a total of 41 weekly downloads. As such, @yawnxyz/sheetlog popularity was classified as not popular.
We found that @yawnxyz/sheetlog demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.