logtail_rust/struct/
log_schema.rs1use crate::r#struct::betterstack_log_schema::BetterStackLogSchema;
2use crate::r#struct::env_config::EnvConfig;
3use crate::r#struct::log_level::LogLevel;
4
5#[derive(Debug)]
6pub struct LogSchema {
7 pub message: String,
8 pub context: String,
9}
10
11impl LogSchema {
12 pub fn to_betterstack(&self, env_config: &EnvConfig, level: LogLevel) -> BetterStackLogSchema {
13 BetterStackLogSchema::new(
14 env_config,
15 level,
16 self.message.clone(),
17 self.context.clone(),
18 )
19 }
20}