1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-18 04:58:51 +02:00

Reduce variables extern'd by the common/log module in debug builds.

These days it is better to include the module in define.yaml when we need to poke at the internal implementation.

This doesn't quite work for the log test harness, so for now some variables will need to remain extern'd in debug builds.
This commit is contained in:
David Steele 2020-03-16 18:16:27 -04:00
parent 3fbfcba811
commit f7dac144a6
4 changed files with 15 additions and 23 deletions

View File

@ -21,27 +21,27 @@ Log Handler
Module variables
***********************************************************************************************************************************/
// Log levels
DEBUG_UNIT_EXTERN LogLevel logLevelStdOut = logLevelError;
DEBUG_UNIT_EXTERN LogLevel logLevelStdErr = logLevelError;
DEBUG_UNIT_EXTERN LogLevel logLevelFile = logLevelOff;
DEBUG_UNIT_EXTERN LogLevel logLevelAny = logLevelError;
static LogLevel logLevelStdOut = logLevelError;
static LogLevel logLevelStdErr = logLevelError;
static LogLevel logLevelFile = logLevelOff;
static LogLevel logLevelAny = logLevelError;
// Log file handles
DEBUG_UNIT_EXTERN int logHandleStdOut = STDOUT_FILENO;
DEBUG_UNIT_EXTERN int logHandleStdErr = STDERR_FILENO;
static int logHandleStdOut = STDOUT_FILENO;
static int logHandleStdErr = STDERR_FILENO;
DEBUG_UNIT_EXTERN int logHandleFile = -1;
// Has the log file banner been written yet?
DEBUG_UNIT_EXTERN bool logFileBanner = false;
// Is the timestamp printed in the log?
DEBUG_UNIT_EXTERN bool logTimestamp = false;
static bool logTimestamp = false;
// Size of the process id field
DEBUG_UNIT_EXTERN int logProcessSize = 2;
static int logProcessSize = 2;
// Prefix DRY-RUN to log messages
DEBUG_UNIT_EXTERN bool logDryRun = false;
static bool logDryRun = false;
/***********************************************************************************************************************************
Dry run prefix

View File

@ -354,6 +354,9 @@ unit:
config/parse: full
config/parse.auto: noCode
include:
- common/log
# ----------------------------------------------------------------------------------------------------------------------------
- name: load
total: 4
@ -361,6 +364,9 @@ unit:
coverage:
config/load: full
include:
- common/log
# ----------------------------------------------------------------------------------------------------------------------------
- name: exec
total: 1

View File

@ -8,14 +8,6 @@ Test Configuration Load
#include "common/harnessConfig.h"
/***********************************************************************************************************************************
Expose log internal data for unit testing/debugging
***********************************************************************************************************************************/
extern LogLevel logLevelStdOut;
extern LogLevel logLevelStdErr;
extern LogLevel logLevelFile;
extern bool logTimestamp;
/***********************************************************************************************************************************
Test run
***********************************************************************************************************************************/

View File

@ -12,12 +12,6 @@ Test Configuration Parse
#define TEST_COMMAND_RESTORE "restore"
#define TEST_COMMAND_VERSION "version"
/***********************************************************************************************************************************
Expose log internal data for unit testing/debugging
***********************************************************************************************************************************/
extern LogLevel logLevelStdOut;
extern LogLevel logLevelStdErr;
/***********************************************************************************************************************************
Option find test -- this is done a lot in the deprecated tests
***********************************************************************************************************************************/