Skip to content

Commit

Permalink
Fix to force the log level also for no output (= '0')
Browse files Browse the repository at this point in the history
-  Log level should be able to be forced also to no
   output in debug mode (which is currently set to '2').
  • Loading branch information
gabyx committed Jan 12, 2021
1 parent 8c36b02 commit 0bd4017
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
25 changes: 25 additions & 0 deletions .githooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Githooks

This project uses [Githooks](https://github.com/rycus86/githooks), that allows running [Git hooks](https://git-scm.com/docs/githooks) checked into this repository. This folder contains hooks that should be executed by everyone who interacts with this source repository. For a documentation on how this works and how to get it [installed](https://github.com/rycus86/githooks#installation), check the project [README](https://github.com/rycus86/githooks/blob/master/README.md) in the [rycus86/githooks](https://github.com/rycus86/githooks) GitHub repository.

## Brief summary

The [directories or files](https://github.com/rycus86/githooks#layout-and-options) in this folder tell Git to execute certain scripts on various [trigger events](https://github.com/rycus86/githooks#supported-hooks), before or after a commit, on every checkout, before a push for example - assuming [Githooks](https://github.com/rycus86/githooks) is already [installed](https://github.com/rycus86/githooks#installation) and [enabled](https://github.com/rycus86/githooks#opt-in-hooks) for the repository. The directory or file names refer to these events, like `pre-commit`, `post-commit`, `post-checkout`, `pre-push`, etc. If they are folders, each file inside them is treated as a hook script (unless [ignored](https://github.com/rycus86/githooks#ignoring-files)), and will be executed when Git runs the hooks as part of the command issued by the user. [Githooks](https://github.com/rycus86/githooks) comes with a [command line helper](https://github.com/rycus86/githooks/blob/master/docs/command-line-tool.md) tool, that allows you to manage its configuration and state with a `git hooks <cmd>` command. See the [documentation](https://github.com/rycus86/githooks/blob/master/docs/command-line-tool.md) or run `git hooks help` for more information and available options.

### Is this safe?

[Githooks](https://github.com/rycus86/githooks) uses an [opt-in model](https://github.com/rycus86/githooks#opt-in-hooks), where it will ask for confirmation whether new or changed scripts should be run or not (or disabled).

### How do I add a new hook script?

Either create a file with the [Git hook](https://github.com/rycus86/githooks#supported-hooks) name, or a directory (recommended) inside the `.githooks` folder, and place files with the individual steps that should be executed for that event inside. If the file is executable, it will be invoked directly, otherwise it is assumed to be a Shell script - unless this file matches one of the [ignore patterns](https://github.com/rycus86/githooks#ignoring-files) in the `.githooks` area.

### How can I see what hooks are active?

You can look at the `.githooks` folder to see the local hooks in the repository, though if you have shared hook repositories defined, those will live under the `~/.githooks/shared` folder. The [command line helper](https://github.com/rycus86/githooks/blob/master/docs/command-line-tool.md) tool can list out all of them for you with `git hooks list`, and you can use it to accept, enable or disable new, changed or existing hooks.

## More information

You can find more information about how this all works in the [README](https://github.com/rycus86/githooks/blob/master/README.md) of the [Githooks](https://github.com/rycus86/githooks) project repository.

If you find it useful, please show your support by starring the project in GitHub!
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ mark_as_advanced(ApproxMVBB_BUILD_EXAMPLE )
set(ApproxMVBB_BUILD_EXAMPLE ON CACHE BOOL "Build the example, the library is automatically built if this is true")

mark_as_advanced(ApproxMVBB_FORCE_MSGLOG_LEVEL)
set(ApproxMVBB_FORCE_MSGLOG_LEVEL "0" CACHE STRING "Force the message log level (0-3), 0 = use deubg/release settings in LogDefines.hpp!")
set(ApproxMVBB_FORCE_MSGLOG_LEVEL "-1" CACHE STRING "Force the message log level (0-3), -1 = use debug/release settings in LogDefines.hpp!")

mark_as_advanced(ApproxMVBB_USE_OPENMP)
set(ApproxMVBB_USE_OPENMP ON CACHE BOOL "Try to use OpenMp for parallel speedup")
Expand Down
4 changes: 2 additions & 2 deletions cmake/FindApproxMVBBSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# ApproxMVBB_CMAKE_DIR - the cmake dir of ot the ApproxMVBB

#Find Include Headers
find_path(ApproxMVBB_INC_DIR
find_path(ApproxMVBB_INC_DIR
NAMES "ApproxMVBB/Config/Config.hpp.in.cmake"
HINTS ${ApproxMVBB_SEARCH_PATH}
PATH_SUFFIXES
Expand All @@ -31,4 +31,4 @@ include(FindPackageHandleStandardArgs)
find_package_handle_standard_args("ApproxMVBBSource" DEFAULT_MSG ApproxMVBB_INC_DIR ApproxMVBB_SRC_DIR ApproxMVBB_CMAKE_DIR)

mark_as_advanced( ApproxMVBB_FORCE_MSGLOG_LEVEL)
set(ApproxMVBB_FORCE_MSGLOG_LEVEL "0" CACHE STRING "Force the message log level (0-3), 0 = use deubg/release settings in LogDefines.hpp!")
set(ApproxMVBB_FORCE_MSGLOG_LEVEL "-1" CACHE STRING "Force the message log level (0-3), -1 = use debug/release settings in LogDefines.hpp!")
2 changes: 1 addition & 1 deletion include/ApproxMVBB/Common/LogDefines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

// Message Log
// ==================================================================================
#if ApproxMVBB_FORCE_MSGLOG_LEVEL > 0
#if ApproxMVBB_FORCE_MSGLOG_LEVEL >= 0
# define ApproxMVBB_MSGLOG_LEVEL ApproxMVBB_FORCE_MSGLOG_LEVEL // force the output level if set in the config!
#else
# ifndef NDEBUG
Expand Down

0 comments on commit 0bd4017

Please sign in to comment.