← All procedures

logs.store

Store a log entry in the database

MCPCLI
Package
@procedures/sqlite · README
Path
["logs","store"]
CLI
mark logs store --level <"trace" | "debug" | "info" | "warn" | "error"> --message <string>
MCP tool
logs.store on the dev-tools server
As data
{"$proc":["logs","store"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/sqlite"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["logs","store"], { level: "trace", message: "<message>" });
console.log(JSON.stringify(result));

From the command line

$ mark logs store --level <"trace" | "debug" | "info" | "warn" | "error"> --message <string>

As data, in a program

{
  "$proc": ["logs", "store"],
  "input": { "level": "trace", "message": "<message>" }
}

Input

FieldTypeRequiredDefaultDescription
level"trace" | "debug" | "info" | "warn" | "error"yesThe level: trace, debug, info, warn or error
messagestringyesThe log message
sessionIdstringnoThe session that the entry belongs to (to group entries)
commandstringnoThe command that made the entry
contextstringnoMore context, for example a package name
dataobjectnoStructured data of the entry
errorStackstringnoThe stack trace of an error
dbPathstringnoThe SQLite database file (default: /home/runner/logs/cli/cli.db). A query does not make a missing file.

Output

FieldTypeRequiredDefaultDescription
idnumberyesThe id of the new log row
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "level": {
        "type": "string",
        "enum": [
          "trace",
          "debug",
          "info",
          "warn",
          "error"
        ],
        "description": "The level: trace, debug, info, warn or error"
      },
      "message": {
        "type": "string",
        "description": "The log message"
      },
      "sessionId": {
        "description": "The session that the entry belongs to (to group entries)",
        "type": "string"
      },
      "command": {
        "description": "The command that made the entry",
        "type": "string"
      },
      "context": {
        "description": "More context, for example a package name",
        "type": "string"
      },
      "data": {
        "description": "Structured data of the entry",
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      },
      "errorStack": {
        "description": "The stack trace of an error",
        "type": "string"
      },
      "dbPath": {
        "description": "The SQLite database file (default: /home/runner/logs/cli/cli.db). A query does not make a missing file.",
        "type": "string"
      }
    },
    "required": [
      "level",
      "message"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "id": {
        "type": "number",
        "description": "The id of the new log row"
      }
    },
    "required": [
      "id"
    ],
    "additionalProperties": {}
  }
}