ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change
on this file since 734908c was
b52abe0,
checked in by Thierry Delisle <tdelisle@…>, 4 years ago
|
Implemented basic language server with no capabilities
|
-
Property mode set to
100644
|
File size:
461 bytes
|
Rev | Line | |
---|
[b52abe0] | 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 | |
---|
| 10 | int g_argc; |
---|
| 11 | char** g_argv; |
---|
| 12 | |
---|
| 13 | static 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 | |
---|
| 21 | std::ostream & log() { |
---|
| 22 | static std::ofstream log = create(); |
---|
| 23 | return log; |
---|
| 24 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.