Skip to content

Commit e869302

Browse files
authoredApr 3, 2025
chore: improve logs (#266)
* yes yes and yes * use bunyan * add comment * format * loglvl comment * merge * woops * import * ok * remove log kind env * default debug * comment * add hierarchical layer
1 parent d90148c commit e869302

File tree

16 files changed

+234
-84
lines changed

16 files changed

+234
-84
lines changed
 

‎Cargo.lock

+55-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml

+12-11
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,18 @@ similar = "2.6.0"
4141
smallvec = { version = "1.13.2", features = ["union", "const_new", "serde"] }
4242
strum = { version = "0.27.1", features = ["derive"] }
4343
# this will use tokio if available, otherwise async-std
44-
sqlx = { version = "0.8.2", features = ["runtime-tokio", "runtime-async-std", "postgres", "json"] }
45-
syn = "1.0.109"
46-
termcolor = "1.4.1"
47-
test-log = "0.2.17"
48-
tokio = { version = "1.40.0", features = ["full"] }
49-
tower-lsp = "0.20.0"
50-
tracing = { version = "0.1.40", default-features = false, features = ["std"] }
51-
tracing-subscriber = "0.3.18"
52-
tree-sitter = "0.20.10"
53-
tree_sitter_sql = { path = "./lib/tree_sitter_sql", version = "0.0.0" }
54-
unicode-width = "0.1.12"
44+
sqlx = { version = "0.8.2", features = ["runtime-tokio", "runtime-async-std", "postgres", "json"] }
45+
syn = "1.0.109"
46+
termcolor = "1.4.1"
47+
test-log = "0.2.17"
48+
tokio = { version = "1.40.0", features = ["full"] }
49+
tower-lsp = "0.20.0"
50+
tracing = { version = "0.1.40", default-features = false, features = ["std"] }
51+
tracing-bunyan-formatter = { version = "0.3.10 " }
52+
tracing-subscriber = "0.3.18"
53+
tree-sitter = "0.20.10"
54+
tree_sitter_sql = { path = "./lib/tree_sitter_sql", version = "0.0.0" }
55+
unicode-width = "0.1.12"
5556

5657
# postgres specific crates
5758
pgt_analyse = { path = "./crates/pgt_analyse", version = "0.0.0" }

‎crates/pgt_cli/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ serde_json = { workspace = true }
3737
tokio = { workspace = true, features = ["io-std", "io-util", "net", "time", "rt", "sync", "rt-multi-thread", "macros"] }
3838
tracing = { workspace = true }
3939
tracing-appender = "0.2.3"
40+
tracing-bunyan-formatter = { workspace = true }
4041
tracing-subscriber = { workspace = true, features = ["env-filter", "json"] }
41-
tracing-tree = "0.4.0"
42+
tracing-tree = { version = "0.4.0", features = ["time"] }
4243

4344
[target.'cfg(unix)'.dependencies]
4445
libc = "0.2.161"

‎crates/pgt_cli/src/cli_options.rs

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub struct CliOptions {
6161
pub reporter: CliReporter,
6262

6363
#[bpaf(
64+
env("PGT_LOG_LEVEL"),
6465
long("log-level"),
6566
argument("none|debug|info|warn|error"),
6667
fallback(LoggingLevel::default()),

‎crates/pgt_cli/src/commands/daemon.rs

+70-30
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ use tokio::runtime::Runtime;
1111
use tracing::subscriber::Interest;
1212
use tracing::{Instrument, Metadata, debug_span, metadata::LevelFilter};
1313
use tracing_appender::rolling::Rotation;
14+
use tracing_bunyan_formatter::{BunyanFormattingLayer, JsonStorageLayer};
1415
use tracing_subscriber::{
15-
Layer,
1616
layer::{Context, Filter},
1717
prelude::*,
1818
registry,
1919
};
20-
use tracing_tree::HierarchicalLayer;
20+
use tracing_tree::{HierarchicalLayer, time::UtcDateTime};
2121

2222
pub(crate) fn start(
2323
session: CliSession,
@@ -78,8 +78,10 @@ pub(crate) fn run_server(
7878
config_path: Option<PathBuf>,
7979
log_path: Option<PathBuf>,
8080
log_file_name_prefix: Option<String>,
81+
log_level: Option<String>,
82+
log_kind: Option<String>,
8183
) -> Result<(), CliDiagnostic> {
82-
setup_tracing_subscriber(log_path, log_file_name_prefix);
84+
setup_tracing_subscriber(log_path, log_file_name_prefix, log_level, log_kind);
8385

8486
let rt = Runtime::new()?;
8587
let factory = ServerFactory::new(stop_on_disconnect);
@@ -181,28 +183,54 @@ async fn start_lsp_proxy(
181183
/// is written to log files rotated on a hourly basis (in
182184
/// `pgt-logs/server.log.yyyy-MM-dd-HH` files inside the system temporary
183185
/// directory)
184-
fn setup_tracing_subscriber(log_path: Option<PathBuf>, log_file_name_prefix: Option<String>) {
186+
fn setup_tracing_subscriber(
187+
log_path: Option<PathBuf>,
188+
log_file_name_prefix: Option<String>,
189+
log_level: Option<String>,
190+
log_kind: Option<String>,
191+
) {
185192
let pgt_log_path = log_path.unwrap_or(pgt_fs::ensure_cache_dir().join("pgt-logs"));
193+
186194
let appender_builder = tracing_appender::rolling::RollingFileAppender::builder();
195+
187196
let file_appender = appender_builder
188197
.filename_prefix(log_file_name_prefix.unwrap_or(String::from("server.log")))
189198
.max_log_files(7)
190199
.rotation(Rotation::HOURLY)
191200
.build(pgt_log_path)
192201
.expect("Failed to start the logger for the daemon.");
193202

194-
registry()
195-
.with(
196-
HierarchicalLayer::default()
197-
.with_indent_lines(true)
198-
.with_indent_amount(2)
199-
.with_bracketed_fields(true)
200-
.with_targets(true)
201-
.with_ansi(false)
202-
.with_writer(file_appender)
203-
.with_filter(LoggingFilter),
204-
)
205-
.init();
203+
let filter = PgtLoggingFilter::from(log_level);
204+
205+
let log_kind = log_kind.unwrap_or("hierarchical".into());
206+
207+
match log_kind.as_str() {
208+
"bunyan" => {
209+
registry()
210+
.with(JsonStorageLayer)
211+
.with(
212+
BunyanFormattingLayer::new("pgt_logs".into(), file_appender)
213+
.with_filter(filter),
214+
)
215+
.init();
216+
}
217+
218+
_ => registry()
219+
.with(
220+
HierarchicalLayer::default()
221+
.with_indent_lines(true)
222+
.with_indent_amount(2)
223+
.with_bracketed_fields(true)
224+
.with_targets(true)
225+
.with_ansi(false)
226+
.with_timer(UtcDateTime {
227+
higher_precision: false,
228+
})
229+
.with_writer(file_appender)
230+
.with_filter(filter),
231+
)
232+
.init(),
233+
}
206234
}
207235

208236
pub fn default_pgt_log_path() -> PathBuf {
@@ -212,22 +240,34 @@ pub fn default_pgt_log_path() -> PathBuf {
212240
}
213241
}
214242

215-
/// Tracing filter enabling:
216-
/// - All spans and events at level info or higher
217-
/// - All spans and events at level debug in crates whose name starts with `pgt`
218-
struct LoggingFilter;
243+
/// Tracing Filter with two rules:
244+
/// For all crates starting with pgt*, use `PGT_LOG_LEVEL` or CLI option or "info" as default
245+
/// For all other crates, use "info"
246+
struct PgtLoggingFilter(LevelFilter);
219247

220-
/// Tracing filter used for spans emitted by `pgt*` crates
221-
const SELF_FILTER: LevelFilter = if cfg!(debug_assertions) {
222-
LevelFilter::TRACE
223-
} else {
224-
LevelFilter::DEBUG
225-
};
248+
impl From<Option<String>> for PgtLoggingFilter {
249+
fn from(value: Option<String>) -> Self {
250+
Self(
251+
value
252+
.map(|lv_filter| match lv_filter.as_str() {
253+
"trace" => LevelFilter::TRACE,
254+
"debug" => LevelFilter::DEBUG,
255+
"info" => LevelFilter::INFO,
256+
"warn" => LevelFilter::WARN,
257+
"error" => LevelFilter::ERROR,
258+
"off" => LevelFilter::OFF,
259+
260+
_ => LevelFilter::INFO,
261+
})
262+
.unwrap_or(LevelFilter::INFO),
263+
)
264+
}
265+
}
226266

227-
impl LoggingFilter {
267+
impl PgtLoggingFilter {
228268
fn is_enabled(&self, meta: &Metadata<'_>) -> bool {
229269
let filter = if meta.target().starts_with("pgt") {
230-
SELF_FILTER
270+
self.0
231271
} else {
232272
LevelFilter::INFO
233273
};
@@ -236,7 +276,7 @@ impl LoggingFilter {
236276
}
237277
}
238278

239-
impl<S> Filter<S> for LoggingFilter {
279+
impl<S> Filter<S> for PgtLoggingFilter {
240280
fn enabled(&self, meta: &Metadata<'_>, _cx: &Context<'_, S>) -> bool {
241281
self.is_enabled(meta)
242282
}
@@ -250,6 +290,6 @@ impl<S> Filter<S> for LoggingFilter {
250290
}
251291

252292
fn max_level_hint(&self) -> Option<LevelFilter> {
253-
Some(SELF_FILTER)
293+
Some(self.0)
254294
}
255295
}

‎crates/pgt_cli/src/commands/mod.rs

+19
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ pub enum PgtCommand {
151151
display_fallback
152152
)]
153153
log_prefix_name: String,
154+
154155
/// Allows to change the folder where logs are stored.
155156
#[bpaf(
156157
env("PGT_LOG_PATH"),
@@ -161,6 +162,24 @@ pub enum PgtCommand {
161162
)]
162163
log_path: PathBuf,
163164

165+
/// Allows to change the log level. Default is debug. This will only affect "pgt*" crates. All others are logged with info level.
166+
#[bpaf(
167+
env("PGT_LOG_LEVEL"),
168+
long("log-level"),
169+
argument("trace|debug|info|warn|error|none"),
170+
fallback(String::from("debug"))
171+
)]
172+
log_level: String,
173+
174+
/// Allows to change the logging format kind. Default is hierarchical.
175+
#[bpaf(
176+
env("PGT_LOG_KIND"),
177+
long("log-kind"),
178+
argument("hierarchical|bunyan"),
179+
fallback(String::from("hierarchical"))
180+
)]
181+
log_kind: String,
182+
164183
#[bpaf(long("stop-on-disconnect"), hide_usage)]
165184
stop_on_disconnect: bool,
166185
/// Allows to set a custom file path to the configuration file,

‎crates/pgt_cli/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,15 @@ impl<'app> CliSession<'app> {
105105
config_path,
106106
log_path,
107107
log_prefix_name,
108+
log_level,
109+
log_kind,
108110
} => commands::daemon::run_server(
109111
stop_on_disconnect,
110112
config_path,
111113
Some(log_path),
112114
Some(log_prefix_name),
115+
Some(log_level),
116+
Some(log_kind),
113117
),
114118
PgtCommand::PrintSocket => commands::daemon::print_socket(),
115119
};

‎crates/pgt_cli/src/logging.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub fn setup_cli_subscriber(level: LoggingLevel, kind: LoggingKind) {
1111
if level == LoggingLevel::None {
1212
return;
1313
}
14+
1415
let format = tracing_subscriber::fmt::layer()
1516
.with_level(true)
1617
.with_target(false)

‎crates/pgt_lsp/src/handlers/completions.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ use anyhow::Result;
33
use pgt_workspace::{WorkspaceError, features::completions::GetCompletionsParams};
44
use tower_lsp::lsp_types::{self, CompletionItem, CompletionItemLabelDetails};
55

6-
#[tracing::instrument(level = "trace", skip_all)]
6+
#[tracing::instrument(level = "debug", skip_all, fields(
7+
url = params.text_document_position.text_document.uri.as_str(),
8+
character = params.text_document_position.position.character,
9+
line = params.text_document_position.position.line
10+
), err)]
711
pub fn get_completions(
812
session: &Session,
913
params: lsp_types::CompletionParams,

‎crates/pgt_lsp/src/handlers/text_document.rs

+12-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ use tower_lsp::lsp_types;
1010
use tracing::error;
1111

1212
/// Handler for `textDocument/didOpen` LSP notification
13-
#[tracing::instrument(level = "debug", skip(session), err)]
13+
#[tracing::instrument(level = "info", skip_all, fields(
14+
url = params.text_document.uri.as_str(),
15+
version = params.text_document.version
16+
), err)]
1417
pub(crate) async fn did_open(
1518
session: &Session,
1619
params: lsp_types::DidOpenTextDocumentParams,
@@ -38,7 +41,11 @@ pub(crate) async fn did_open(
3841
}
3942

4043
// Handler for `textDocument/didChange` LSP notification
41-
#[tracing::instrument(level = "debug", skip(session), err)]
44+
#[tracing::instrument(level = "debug", skip_all, fields(
45+
uri = params.text_document.uri.as_str(),
46+
version = params.text_document.version,
47+
num_content_changes = params.content_changes.len()
48+
), err)]
4249
pub(crate) async fn did_change(
4350
session: &Session,
4451
params: lsp_types::DidChangeTextDocumentParams,
@@ -90,7 +97,9 @@ pub(crate) async fn did_change(
9097
}
9198

9299
/// Handler for `textDocument/didClose` LSP notification
93-
#[tracing::instrument(level = "debug", skip(session), err)]
100+
#[tracing::instrument(level = "info", skip_all, fields(
101+
url = params.text_document.uri.as_str(),
102+
), err)]
94103
pub(crate) async fn did_close(
95104
session: &Session,
96105
params: lsp_types::DidCloseTextDocumentParams,

‎crates/pgt_lsp/src/server.rs

+7-8
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,13 @@ impl LanguageServer for LSPServer {
152152
}
153153

154154
#[tracing::instrument(level = "info", skip_all)]
155-
async fn did_change_configuration(&self, params: DidChangeConfigurationParams) {
156-
let _ = params;
155+
async fn did_change_configuration(&self, _params: DidChangeConfigurationParams) {
157156
self.session.load_workspace_settings().await;
158157
self.setup_capabilities().await;
159158
self.session.update_all_diagnostics().await;
160159
}
161160

162-
#[tracing::instrument(level = "trace", skip(self))]
161+
#[tracing::instrument(level = "trace", skip_all)]
163162
async fn did_change_watched_files(&self, params: DidChangeWatchedFilesParams) {
164163
let file_paths = params
165164
.changes
@@ -195,28 +194,28 @@ impl LanguageServer for LSPServer {
195194
}
196195
}
197196

198-
#[tracing::instrument(level = "trace", skip(self))]
197+
#[tracing::instrument(level = "trace", skip_all)]
199198
async fn did_open(&self, params: DidOpenTextDocumentParams) {
200199
handlers::text_document::did_open(&self.session, params)
201200
.await
202201
.ok();
203202
}
204203

205-
#[tracing::instrument(level = "trace", skip(self, params))]
204+
#[tracing::instrument(level = "trace", skip_all)]
206205
async fn did_change(&self, params: DidChangeTextDocumentParams) {
207206
if let Err(e) = handlers::text_document::did_change(&self.session, params).await {
208207
error!("{}", e);
209208
};
210209
}
211210

212-
#[tracing::instrument(level = "trace", skip(self))]
211+
#[tracing::instrument(level = "trace", skip_all)]
213212
async fn did_close(&self, params: DidCloseTextDocumentParams) {
214213
handlers::text_document::did_close(&self.session, params)
215214
.await
216215
.ok();
217216
}
218217

219-
#[tracing::instrument(level = "trace", skip(self))]
218+
#[tracing::instrument(level = "trace", skip_all)]
220219
async fn completion(&self, params: CompletionParams) -> LspResult<Option<CompletionResponse>> {
221220
match handlers::completions::get_completions(&self.session, params) {
222221
Ok(result) => LspResult::Ok(Some(result)),
@@ -228,7 +227,7 @@ impl LanguageServer for LSPServer {
228227
async fn code_action(&self, params: CodeActionParams) -> LspResult<Option<CodeActionResponse>> {
229228
match handlers::code_actions::get_actions(&self.session, params) {
230229
Ok(result) => {
231-
tracing::info!("Got Code Actions: {:?}", result);
230+
tracing::trace!("Got {} Code Action(s)", result.len());
232231
return LspResult::Ok(Some(result));
233232
}
234233
Err(e) => LspResult::Err(into_lsp_error(e)),

‎crates/pgt_text_size/src/size.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ use {
22
crate::TextLen,
33
std::{
44
convert::TryFrom,
5-
fmt, iter,
5+
fmt::{self, Display},
6+
iter,
67
num::TryFromIntError,
78
ops::{Add, AddAssign, Sub, SubAssign},
89
},
@@ -31,6 +32,12 @@ impl fmt::Debug for TextSize {
3132
}
3233
}
3334

35+
impl Display for TextSize {
36+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
37+
write!(f, "{}", self.raw)
38+
}
39+
}
40+
3441
impl TextSize {
3542
/// Creates a new instance of `TextSize` from a raw `u32`.
3643
#[inline]

‎crates/pgt_workspace/src/settings.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl AsMut<Settings> for SettingsHandleMut<'_> {
7878

7979
impl Settings {
8080
/// The [PartialConfiguration] is merged into the workspace
81-
#[tracing::instrument(level = "trace", skip(self))]
81+
#[tracing::instrument(level = "trace", skip(self), err)]
8282
pub fn merge_with_configuration(
8383
&mut self,
8484
configuration: PartialConfiguration,

‎crates/pgt_workspace/src/workspace/server.rs

+33-25
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ impl Workspace for WorkspaceServer {
153153
/// ## Panics
154154
/// This function may panic if the internal settings mutex has been poisoned
155155
/// by another thread having previously panicked while holding the lock
156-
#[tracing::instrument(level = "trace", skip(self))]
156+
#[tracing::instrument(level = "trace", skip(self), err)]
157157
fn update_settings(&self, params: UpdateSettingsParams) -> Result<(), WorkspaceError> {
158158
tracing::info!("Updating settings in workspace");
159159

@@ -179,10 +179,8 @@ impl Workspace for WorkspaceServer {
179179
}
180180

181181
/// Add a new file to the workspace
182-
#[tracing::instrument(level = "trace", skip(self))]
182+
#[tracing::instrument(level = "info", skip_all, fields(path = params.path.as_path().as_os_str().to_str()), err)]
183183
fn open_file(&self, params: OpenFileParams) -> Result<(), WorkspaceError> {
184-
tracing::info!("Opening file: {:?}", params.path);
185-
186184
let doc = Document::new(params.path.clone(), params.content, params.version);
187185

188186
doc.iter_statements_with_text().for_each(|(stmt, content)| {
@@ -211,6 +209,10 @@ impl Workspace for WorkspaceServer {
211209
}
212210

213211
/// Change the content of an open file
212+
#[tracing::instrument(level = "debug", skip_all, fields(
213+
path = params.path.as_os_str().to_str(),
214+
version = params.version
215+
), err)]
214216
fn change_file(&self, params: super::ChangeFileParams) -> Result<(), WorkspaceError> {
215217
let mut doc = self
216218
.documents
@@ -221,22 +223,39 @@ impl Workspace for WorkspaceServer {
221223
params.version,
222224
));
223225

224-
tracing::info!("Changing file: {:?}", params);
225-
226226
for c in &doc.apply_file_change(&params) {
227227
match c {
228228
StatementChange::Added(added) => {
229-
tracing::debug!("Adding statement: {:?}", added);
229+
tracing::debug!(
230+
"Adding statement: id:{:?}, path:{:?}, text:{:?}",
231+
added.stmt.id,
232+
added.stmt.path.as_os_str().to_str(),
233+
added.text
234+
);
230235
self.tree_sitter.add_statement(&added.stmt, &added.text);
231236
self.pg_query.add_statement(&added.stmt, &added.text);
232237
}
233238
StatementChange::Deleted(s) => {
234-
tracing::debug!("Deleting statement: {:?}", s);
239+
tracing::debug!(
240+
"Deleting statement: id:{:?}, path:{:?}",
241+
s.id,
242+
s.path.as_os_str()
243+
);
235244
self.tree_sitter.remove_statement(s);
236245
self.pg_query.remove_statement(s);
237246
}
238247
StatementChange::Modified(s) => {
239-
tracing::debug!("Modifying statement: {:?}", s);
248+
tracing::debug!(
249+
"Modifying statement with id {:?} (new id {:?}) in {:?}. Range {:?}, Changed from '{:?}' to '{:?}', changed text: {:?}",
250+
s.old_stmt.id,
251+
s.new_stmt.id,
252+
s.old_stmt.path.as_os_str().to_str(),
253+
s.change_range,
254+
s.old_stmt_text,
255+
s.new_stmt_text,
256+
s.change_text
257+
);
258+
240259
self.tree_sitter.modify_statement(s);
241260
self.pg_query.modify_statement(s);
242261
}
@@ -498,17 +517,14 @@ impl Workspace for WorkspaceServer {
498517
})
499518
}
500519

501-
#[tracing::instrument(level = "debug", skip(self))]
520+
#[tracing::instrument(level = "debug", skip_all, fields(
521+
path = params.path.as_os_str().to_str(),
522+
position = params.position.to_string()
523+
), err)]
502524
fn get_completions(
503525
&self,
504526
params: GetCompletionsParams,
505527
) -> Result<CompletionsResult, WorkspaceError> {
506-
tracing::debug!(
507-
"Getting completions for file {:?} at position {:?}",
508-
&params.path,
509-
&params.position
510-
);
511-
512528
let pool = match self.connection.read().unwrap().get_pool() {
513529
Some(pool) => pool,
514530
None => return Ok(CompletionsResult::default()),
@@ -519,12 +535,6 @@ impl Workspace for WorkspaceServer {
519535
.get(&params.path)
520536
.ok_or(WorkspaceError::not_found())?;
521537

522-
tracing::debug!(
523-
"Found the document. Looking for statement in file {:?} at position: {:?}",
524-
&params.path,
525-
&params.position
526-
);
527-
528538
let (statement, stmt_range, text) = match doc
529539
.iter_statements_with_text_and_range()
530540
.find(|(_, r, _)| r.contains(params.position))
@@ -540,7 +550,7 @@ impl Workspace for WorkspaceServer {
540550
let tree = self.tree_sitter.get_parse_tree(&statement);
541551

542552
tracing::debug!(
543-
"Found the statement. We're looking for position {:?}. Statement Range {:?} to {:?}. Statement: {}",
553+
"Found the statement. We're looking for position {:?}. Statement Range {:?} to {:?}. Statement: {:?}",
544554
position,
545555
stmt_range.start(),
546556
stmt_range.end(),
@@ -549,8 +559,6 @@ impl Workspace for WorkspaceServer {
549559

550560
let schema_cache = self.schema_cache.load(pool)?;
551561

552-
tracing::debug!("Loaded schema cache for completions");
553-
554562
let items = pgt_completions::complete(pgt_completions::CompletionParams {
555563
position,
556564
schema: schema_cache.as_ref(),

‎crates/pgt_workspace/src/workspace/server/pg_query.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl PgQueryStore {
2828
if let Ok(ast) = r {
2929
self.ast_db.insert(statement.clone(), Arc::new(ast));
3030
} else {
31-
tracing::info!("adding diagnostics");
31+
tracing::info!("invalid statement, adding diagnostics.");
3232
self.diagnostics
3333
.insert(statement.clone(), SyntaxDiagnostic::from(r.unwrap_err()));
3434
}

‎justfile

+3
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,8 @@ merge-main:
109109

110110

111111
# Make sure to set your PGT_LOG_PATH in your shell profile.
112+
# You can use the PGT_LOG_LEVEL to set your log level.
113+
# We recommend to install `bunyan` (npm i -g bunyan) and pipe the output through there for color-coding:
114+
# just show-logs | bunyan
112115
show-logs:
113116
tail -f $(ls $PGT_LOG_PATH/server.log.* | sort -t- -k2,2 -k3,3 -k4,4 | tail -n 1)

0 commit comments

Comments
 (0)
Please sign in to comment.