source: tools/langserver/src/log.cpp @ b52abe0

arm-ehjacob/cs343-translationnew-astnew-ast-unique-expr
Last change on this file since b52abe0 was b52abe0, checked in by Thierry Delisle <tdelisle@…>, 20 months ago

Implemented basic language server with no capabilities

  • Property mode set to 100644
File size: 461 bytes
Line 
1#include "log.hpp"
2
3#include <iostream>
4#include <fstream>
5
6#include <unistd.h>
7#include <sys/types.h>
8#include <pwd.h>
9
10int g_argc;
11char** g_argv;
12
13static std::ofstream create() {
14      struct passwd *pw = getpwuid(getuid());
15      const char *homedir = pw->pw_dir;
16
17      std::string target = std::string(homedir) + "/.cfa-ls.log";
18      return std::ofstream{ target };
19}
20
21std::ostream & log() {
22      static std::ofstream log = create();
23      return log;
24}
Note: See TracBrowser for help on using the repository browser.