Commit Graph

5 Commits

Author SHA1 Message Date
Matt Glazar
470bdcd870 Write all 'eden start' messages to stderr
Summary:
Logging some messages to stdout and some messages to stderr has a few problems:

* stdout and stderr can get interleaved. For pipes, interleaving is avoidable for messages smaller than PIPE_BUF (512 bytes), but there's no guarantee that stdout and stderr are pipes or that the reader of the pipe reads PIPE_BUF bytes at a time.
* For the systemd integration I am developing, I need one file for stderr logs and another file for stdout logs. This is more complicated than having a single file for all logs.
* The distinction between stdout and stderr is unclear. No messages from StartupLogger are meant to be piped to another program.

Address these problems by only logging to stderr.

From a user's point of view, this diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D10370931

fbshipit-source-id: b063ed3a66cefc846d30ce1486759cbd3f3ea29e
2018-10-22 20:27:25 -07:00
Matt Glazar
5fc382019d Print log file path separately from "started" message
Summary:
I want to split the StartupLogger class (see D10228156). The split will make logPath_ inaccessible from the success() function. I see two solutions:

* Make successImpl() (called by success()) write the entire message. This means each implementation of successImpl() needs to log the same "Started edenfs" message.
* Make success() write just the "Started edenfs" message, and have successImpl() write the "Logs available at" message (if possible). This means each implementation of successImpl() which has a log file needs to log the same "Logs available at" message, but in the short term there will be only one such implementation.

Implement the latter solution to minimize source code size.

Reviewed By: simpkins

Differential Revision: D10228164

fbshipit-source-id: aaa03e9d8c1d08c00a388a7fcaa76aa3f629decf
2018-10-12 17:06:41 -07:00
Puneet Kaushik
eeaf1c0025 Started Eden for Windows and integrated hg store with it.
Summary:
This diff is first in the series to make Eden work on Windows. It includes:

1. HG backing store and Object store, which provides the capability to talk to mercurial and fetch the file and folder contents on Windows.
2. Subprocess and Pipe definition for Windows.
3. The Visual studio solution and projects files to compile Eden and scm datapack.

Few Important points:

1. Most of the changes to existing code is done under a macro EDEN_WIN so that it doesn't impact on other platform.
2. Sqlite is used for caching the fetched contents. We are not using Rocksdb on Windows.
3. The main function only calls some test code and exit after printing the output.
4. The initializeMononoke code is disabled for Windows because it needs Proxygen to talk HTTP. Will enable this once I get Proxygen and other dependencies working.
5. HgImporter pass Windows handles to hg_import_helper as command line args. The code to convert these handles into fds is in a separate diff.

Reviewed By: wez

Differential Revision: D8653992

fbshipit-source-id: 52a3c3750425fb92c2a7158c2c214a9372661e13
2018-08-21 17:53:38 -07:00
Harsh Poddar
6289c96520 Add function name property to LogMessage
Summary: This update adds the name of the function which called the LOG() to the `LogMessage` object so that a custom formatter could use it to show method name with logs.

Reviewed By: simpkins

Differential Revision: D9071926

fbshipit-source-id: 9d5359d84cf2544371c6f1826f99d8b47a272dd1
2018-08-07 11:51:36 -07:00
Adam Simpkins
b8a16e9652 add a StartupLogger helper class
Summary:
This adds a small helper class for printing startup status messages to the
user, and for signaling startup status over a pipe.

This will make it possible in a future diff for edenfs to daemonize, but still
communicate messages back to the parent process to report what it is doing
until it finishes the start-up steps.

Reviewed By: strager

Differential Revision: D8372250

fbshipit-source-id: 53a897944beeb1582a090a2b69afbc2b41408d52
2018-06-21 15:16:06 -07:00