5 Commits
Author SHA1 Message Date
Matsubaa d8253fcc30 Replace console logger with a basic Clogger implementation; remove log dependency and increment version to 0.1.2
cargo build / build (push) Successful in 6s
cargo test / test (push) Successful in 3s
cargo test / publish (push) Successful in 3s
2026-08-22 13:36:02 -05:00
Matsubaa 1dea6c479d Add GitLink plugin settings for IntelliJ configuration 2026-08-22 12:56:19 -05:00
Matsubaa ee8ab46a53 Add build workflow to JSON schemas; refine Cargo publish step in test workflow 2026-08-22 10:15:08 -05:00
Matsubaa b11d13ac61 Add build workflow to JSON schemas; refine Cargo publish step in test workflow
cargo build / build (push) Successful in 7s
cargo test / test (push) Successful in 3s
cargo test / publish (push) Successful in 4s
2026-08-22 10:09:44 -05:00
Matsubaa 2b07013ad7 Add build workflow to JSON schemas; refine Cargo publish step in test workflow
cargo build / build (push) Successful in 7s
cargo test / test (push) Successful in 6s
cargo test / publish (push) Skipped
2026-08-22 10:07:28 -05:00
6 changed files with 18 additions and 42 deletions
+1 -1
View File
@@ -44,5 +44,5 @@ jobs:
- name: Publish to Gitea Cargo registry
env:
CARGO_REGISTRIES_GITEA_TOKEN: ${{ secrets.CARGO_TOKEN }}
CARGO_REGISTRIES_GITEA_TOKEN: "Bearer ${{ secrets.CARGO_TOKEN }}"
run: nix develop --extra-experimental-features "nix-command flakes" -c cargo publish --registry gitea --verbose
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="uk.co.ben_gibson.git.link.SettingsState">
<option name="host" value="e0f86390-1091-4871-8aeb-f534fbc99cf0" />
</component>
</project>
Generated
+1 -10
View File
@@ -4,13 +4,4 @@ version = 4
[[package]]
name = "kt_log"
version = "0.1.0"
dependencies = [
"log",
]
[[package]]
name = "log"
version = "0.4.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"
version = "0.1.2"
+1 -3
View File
@@ -1,6 +1,6 @@
[package]
name = "kt_log"
version = "0.1.0"
version = "0.1.2"
edition = "2024"
description = "A console logging library for Rust applications"
license = "MIT"
@@ -11,5 +11,3 @@ autobins = false
name = "kt_log"
path = "src/lib.rs"
[dependencies]
log = "0.4"
+3
View File
@@ -11,6 +11,9 @@ This project is intended for educational purposes. To support this, please adher
- **Source Code Editing:** You are NOT allowed to edit the executable source code (`src/` directory) except to improve documentation..
- **Code Generation:** Do not provide example code unless explicitly asked by the user.
## CI/CD & Registry Requirements
- **Gitea Cargo Registry Token Format:** When configuring authentication tokens for the Gitea Cargo package registry (in CI workflows via `CARGO_REGISTRIES_<NAME>_TOKEN` or in `~/.cargo/credentials.toml`), the token MUST include the `"Bearer "` prefix (e.g., `CARGO_REGISTRIES_GITEA_TOKEN: "Bearer ${{ secrets.CARGO_TOKEN }}"` or `token = "Bearer <token>"`). Cargo passes the token verbatim into the `Authorization` HTTP header, and Gitea requires the standard `Bearer ` scheme prefix; passing a raw token without `Bearer ` causes `401 Unauthorized: Failed to authenticate user`.
## Communication Guidelines
- **Educational Focus:** When asked about code, prioritize explaining the concepts and providing advice over writing code.
- **Documentation Links:** Always include links to official language or library documentation for references.
+6 -28
View File
@@ -1,30 +1,8 @@
// src/lib.rs
//! Console logging utilities for Rust applications.
use log::{Level, LevelFilter, Metadata, Record, SetLoggerError};
/// A minimal console logger implementation.
pub struct ConsoleLogger;
static LOGGER: ConsoleLogger = ConsoleLogger;
impl log::Log for ConsoleLogger {
fn enabled(&self, metadata: &Metadata<'_>) -> bool {
metadata.level() <= Level::Info
}
fn log(&self, record: &Record<'_>) {
if self.enabled(record.metadata()) {
println!("[{}] {}", record.level(), record.args());
}
}
fn flush(&self) {}
struct Clogger{
}
/// Initializes the console logger with `Info` as the maximum log level.
pub fn init() -> Result<(), SetLoggerError> {
log::set_logger(&LOGGER)?;
log::set_max_level(LevelFilter::Info);
Ok(())
impl Clogger{
pub fn output(){
println!("Hello, world!");
}
}