A lightweight utility that automatically submits the most recent log file from your project as a GitHub issue. Perfect for capturing and tracking application errors with minimal effort.
- Automatically finds the most recent log file in the
logs
directory - Creates a GitHub issue with the log content
- Configurable through environment variables
- Simple command-line interface
log-submission-tool
├── src
│ ├── index.ts # Entry point of the application
│ ├── github.ts # Function to create GitHub issues
│ ├── logReader.ts # Function to read the latest log file
│ └── config.ts # Configuration settings and environment variables
├── logs # Directory for log files
│ └── .gitkeep # Keeps the logs directory in version control
├── .env.template # Template for environment variables
├── package.json # npm configuration file
├── tsconfig.json # TypeScript configuration file
└── README.md # Project documentation
-
Clone the repository:
git clone http://github.com/amcgready/timber.git cd log-submission-tool
-
Install dependencies:
npm install
-
Configure environment variables:
- Copy
.env.template
to.env
and update the values with your GitHub repository information:
cp .env.template .env
- Edit the
.env
file with your GitHub token and repository name:
GITHUB_TOKEN=your_github_token GITHUB_REPO=your_username/your_repository
- Copy
-
Build the project:
npm run build
To submit the most recent log file as a GitHub issue:
npm run submit-log
For a one-off submission, you can also run:
npx ts-node src/index.ts
Place your log files in the logs
directory with a .log
extension. The tool will automatically find the most recent file by modification date.
The created GitHub issue will include:
- A title with the log file name and timestamp
- The complete log content in a code block
- Submission timestamp details
- No log files found: Ensure
.log
files exist in thelogs
directory - Authentication errors: Verify your GitHub token has the proper permissions
- Repository not found: Check that the repository name is correct in the
.env
file
MIT
Feel free to submit issues or pull requests to improve the tool.