Skip to content

Commit

Permalink
add telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
DaviRain-Su committed May 31, 2024
1 parent 21477ce commit 8f4d603
Show file tree
Hide file tree
Showing 5 changed files with 275 additions and 18 deletions.
199 changes: 196 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "star-kirby-lang"
version = "0.1.1"
edition = "2021"

[lib]
path = "src/lib.rs"

[[bin]]
name = "star-kirby-lang"
path = "src/main.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand All @@ -13,4 +20,9 @@ global = "0.4.3"
thiserror = "1.0.50"
nom = "7.1.3"
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
tracing-subscriber = { version = "0.3.18", features = [
"env-filter",
"registry",
] }
tracing-bunyan-formatter = "0.3.9"
tracing-log = "0.2.0"
13 changes: 13 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#[macro_use]
extern crate lazy_static;
extern crate core;

pub mod ast;
pub mod error;
pub mod evaluator;
pub mod lexer;
pub mod object;
pub mod parser;
pub mod repl;
pub mod telemetry;
pub mod token;
19 changes: 5 additions & 14 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
#[macro_use]
extern crate lazy_static;
extern crate core;

use star_kirby_lang::repl;
use star_kirby_lang::telemetry;
use std::io;

pub mod ast;
pub mod error;
pub mod evaluator;
pub mod lexer;
pub mod object;
pub mod parser;
pub mod repl;
pub mod token;

fn main() -> anyhow::Result<()> {
tracing_subscriber::fmt::init();
let subscriber =
telemetry::get_subscriber("star-kirby-lang".into(), "info".into(), std::io::stdout);
telemetry::init_subscriber(subscriber)?;
println!(
"Hello {}! This is the Monkey programming language!",
whoami::username()
Expand Down
Loading

0 comments on commit 8f4d603

Please sign in to comment.