Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ func main() {
setupFlags()
pgURI, stateChangeFileName, stateChangeIndexFileName, stateChangeMempoolFileName, consumerProgressFileName, batchBytes, threadLimit, logQueries, readOnlyUserPassword, explorerStatistics := getConfigValues()

// Print all the config values in a single printf call broken up
// with newlines and make it look pretty both printed out and in code
glog.Infof(`
PostgresDataHandler Config Values:
---------------------------------
DB_HOST: %s
DB_PORT: %s
DB_USERNAME: %s
DB_PASSWORD: %s
STATE_CHANGE_FILE_NAME: %s
CONSUMER_PROGRESS_FILE_NAME: %s
BATCH_BYTES: %d
THREAD_LIMIT: %d
LOG_QUERIES: %t
READONLY_USER_PASSWORD: %s
CALCULATE_EXPLORER_STATISTICS: %t
`, viper.GetString("DB_HOST"), viper.GetString("DB_PORT"),
viper.GetString("DB_USERNAME"), viper.GetString("DB_PASSWORD"),
stateChangeFileName, consumerProgressFileName, batchBytes, threadLimit,
logQueries, readOnlyUserPassword, explorerStatistics)

// Initialize the DB.
db, err := setupDb(pgURI, threadLimit, logQueries, readOnlyUserPassword, explorerStatistics)
if err != nil {
Expand Down