mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-12 13:26:51 +00:00
Add unified file and LSP logging using tracing to server
This commit is contained in:
parent
fd0fc0a8d2
commit
5b8b7546b6
4 changed files with 151 additions and 3 deletions
|
@ -23,6 +23,7 @@ use tower_lsp_server::lsp_types::TextDocumentSyncOptions;
|
|||
use tower_lsp_server::lsp_types::WorkspaceFoldersServerCapabilities;
|
||||
use tower_lsp_server::lsp_types::WorkspaceServerCapabilities;
|
||||
use tower_lsp_server::LanguageServer;
|
||||
use tracing_appender::non_blocking::WorkerGuard;
|
||||
|
||||
use crate::log_error;
|
||||
use crate::log_info;
|
||||
|
@ -35,14 +36,16 @@ const SERVER_VERSION: &str = "0.1.0";
|
|||
pub struct DjangoLanguageServer {
|
||||
session: Arc<RwLock<Option<Session>>>,
|
||||
queue: Queue,
|
||||
_log_guard: WorkerGuard,
|
||||
}
|
||||
|
||||
impl DjangoLanguageServer {
|
||||
#[must_use]
|
||||
pub fn new() -> Self {
|
||||
pub fn new(log_guard: WorkerGuard) -> Self {
|
||||
Self {
|
||||
session: Arc::new(RwLock::new(None)),
|
||||
queue: Queue::new(),
|
||||
_log_guard: log_guard,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue