From 531e8ab66d05afe13b04af190835615b6f2023f9 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Tue, 16 Feb 2021 13:54:06 +0100
Subject: [PATCH] CONFIG: relocate messageStream output level control to an
 InfoSwitch

- location and naming more consistent with other controls

    old: DebugSwitch  'level'
    new: InfoSwitch   'outputLevel'
---
 etc/controlDict                       | 8 +++++++-
 src/OpenFOAM/db/error/messageStream.C | 4 ++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/etc/controlDict b/etc/controlDict
index d928d90a748..7543b57fc41 100644
--- a/etc/controlDict
+++ b/etc/controlDict
@@ -36,6 +36,13 @@ InfoSwitches
     // The default ASCII write precision
     writePrecision  6;
 
+    // The output level (verbosity) of messages
+    //  - 0 : suppress all output
+    //  - 1 : normal output
+    //  - >= 2 : report source file and line number (default)
+    outputLevel     2;
+
+    // Report information as baseIOdictionary are read in
     writeDictionaries 0;
 
     // Report optional dictionary entries. For value > 1, treat as fatal.
@@ -671,7 +678,6 @@ DebugSwitches
     lduMesh             0;
     leastSquares        0;
     leastSquaresVectors 0;
-    level               2;
     limitWith           0;
     limited             0;
     limitedCubic        0;
diff --git a/src/OpenFOAM/db/error/messageStream.C b/src/OpenFOAM/db/error/messageStream.C
index 0d6778ef35c..4e12142f6ce 100644
--- a/src/OpenFOAM/db/error/messageStream.C
+++ b/src/OpenFOAM/db/error/messageStream.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2016 OpenFOAM Foundation
-    Copyright (C) 2017-2020 OpenCFD Ltd.
+    Copyright (C) 2017-2021 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -33,7 +33,7 @@ License
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
 // Default is 2 : report source file name and line number if available
-int Foam::messageStream::level(Foam::debug::debugSwitch("level", 2));
+int Foam::messageStream::level(Foam::debug::infoSwitch("outputLevel", 2));
 
 int Foam::messageStream::redirect(0);
 
-- 
GitLab