Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cpplib
Commits
507d4e3e
Commit
507d4e3e
authored
2 years ago
by
Daniel Hornung
Browse files
Options
Downloads
Plain Diff
Merge branch 'f-octave-logging' into 'dev'
F octave logging See merge request
!41
parents
c4c61b83
a341d35f
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!42
Release 0.2.0
,
!41
F octave logging
Pipeline
#25891
passed
2 years ago
Stage: info
Stage: setup
Stage: test
Stage: deploy
Pipeline: CaosDB Octave library
#25897
Pipeline: caosdb-cppinttest
#25896
Pipeline: caosdb-julialib
#25895
Changes
4
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+60
-3
60 additions, 3 deletions
.gitlab-ci.yml
doc/CHANGELOG.md
+2
-0
2 additions, 0 deletions
doc/CHANGELOG.md
include/caosdb/logging.h
+3
-0
3 additions, 0 deletions
include/caosdb/logging.h
src/caosdb/logging.cpp
+12
-0
12 additions, 0 deletions
src/caosdb/logging.cpp
with
77 additions
and
3 deletions
.gitlab-ci.yml
+
60
−
3
View file @
507d4e3e
...
...
@@ -24,6 +24,8 @@ variables:
CPPLIB_REGISTRY_IMAGE
:
$CI_REGISTRY/caosdb/src/caosdb-cpplib/testenv:$CI_COMMIT_REF_NAME
CPPINTTEST_BRANCHES
:
https://gitlab.indiscale.com/api/v4/projects/111/repository/branches
OCTAVELIB_BRANCHES
:
https://gitlab.indiscale.com/api/v4/projects/117/repository/branches
JULIALIB_BRANCHES
:
https://gitlab.indiscale.com/api/v4/projects/116/repository/branches
GIT_SUBMODULE_STRATEGY
:
normal
## FOR DEBUGGING
...
...
@@ -103,28 +105,45 @@ trigger_prepare:
# ... use an f-branch if posible...
-
F_BRANCH=dev
-
if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then
F_BRANCH=$CI_COMMIT_REF_NAME ;
if curl -o /dev/null -s -w "%{http_code}" $CPPINTTEST_BRANCHES/$CI_COMMIT_REF_NAME | grep "404"; then
CPPINT_REF=dev ;
F_BRANCH=dev ;
else
CPPINT_REF=$CI_COMMIT_REF_NAME ;
F_BRANCH=$CI_COMMIT_REF_NAME ;
fi
fi;
if curl -o /dev/null -s -w "%{http_code}" $OCTAVELIB_BRANCHES/$CI_COMMIT_REF_NAME | grep "404"; then
OCTAVELIB_REF=dev ;
else
OCTAVELIB_REF=$CI_COMMIT_REF_NAME ;
fi;
if curl -o /dev/null -s -w "%{http_code}" $JULIALIB_BRANCHES/$CI_COMMIT_REF_NAME | grep "404"; then
JULIALIB_REF=dev ;
else
JULIALIB_REF=$CI_COMMIT_REF_NAME ;
fi;
fi;
# ... or use main if possible...
-
if [[ "$CI_COMMIT_REF_NAME" == "main" ]] ; then
CPPINT_REF=main ;
OCTAVELIB_REF=main ;
JULIALIB_REF=main
F_BRANCH=main ;
fi
-
if echo "$CI_COMMIT_REF_NAME" | grep -c "^v" ; then
CPPINT_REF=main ;
OCTAVELIB_REF=main ;
JULIALIB_REF=main ;
F_BRANCH=main ;
fi
# ... and fall-back to dev
-
CPPINT_REF=${CPPINT_REF:-dev}
-
OCTAVELIB_REF=${OCTAVELIB_REF:-dev}
-
JULIALIB_REF=${JULIALIB_REF:-dev}
# Write to dotenv
-
echo "CPPINT_REF=${CPPINT_REF}" >> "$DOTENV"
-
echo "OCTAVELIB_REF=${OCTAVELIB_REF}" >> "$DOTENV"
-
echo "JULIALIB_REF=${JULIALIB_REF}" >> "$DOTENV"
-
echo "F_BRANCH=${F_BRANCH}" >> "$DOTENV"
-
cat "$DOTENV"
artifacts
:
...
...
@@ -154,6 +173,44 @@ trigger_inttest:
branch
:
$CPPINT_REF
strategy
:
depend
# After the cppinttest have been successful, also start tests for Octave...
trigger_octavelib
:
stage
:
deploy
needs
:
[
trigger_prepare
]
inherit
:
variables
:
# List the variables that shall be inherited, which also means they will override any equally
# named varibles in child pipelines.
-
TRIGGERED_BY_REPO
-
TRIGGERED_BY_REF
-
TRIGGERED_BY_HASH
-
CPPLIB_REGISTRY_IMAGE
variables
:
# dotenv variables must be set again here.
F_BRANCH
:
$F_BRANCH
trigger
:
project
:
caosdb/src/caosdb-octavelib
branch
:
$OCTAVELIB_REF
# ... and for Julia.
trigger_julialib
:
stage
:
deploy
needs
:
[
trigger_prepare
]
inherit
:
variables
:
# List the variables that shall be inherited, which also means they will override any equally
# named varibles in child pipelines.
-
TRIGGERED_BY_REPO
-
TRIGGERED_BY_REF
-
TRIGGERED_BY_HASH
-
CPPLIB_REGISTRY_IMAGE
variables
:
# dotenv variables must be set again here.
F_BRANCH
:
$F_BRANCH
trigger
:
project
:
caosdb/src/caosdb-julialib
branch
:
$JULIALIB_REF
# Build the sphinx documentation and make it ready for deployment by Gitlab Pages
# Special job for serving a static website. See https://docs.gitlab.com/ee/ci/yaml/README.html#pages
.pages_prepare
:
&pages_prepare
...
...
This diff is collapsed.
Click to expand it.
doc/CHANGELOG.md
+
2
−
0
View file @
507d4e3e
...
...
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
*
Simple
`User`
class and methods for user creation/retrieval/deletion.
*
Added more variants for the
`operator<<`
of
`LoggerOutputStream`
(for
`bool`
and
`std::endl`
).
### Changed
...
...
This diff is collapsed.
Click to expand it.
include/caosdb/logging.h
+
3
−
0
View file @
507d4e3e
...
...
@@ -27,6 +27,7 @@
#include
<cstdint>
// for uint64_t
#include
<iosfwd>
// for streamsize
#include
<memory>
// for shared_ptr
#include
<ostream>
// for ostream
#include
<string>
// for string
#include
<vector>
// for vector
...
...
@@ -37,6 +38,8 @@ const std::string logger_name = "caosdb::logging";
class
LoggerOutputStream
{
public:
LoggerOutputStream
(
std
::
string
channel
,
int
level
);
auto
operator
<<
(
std
::
ostream
&
(
*
f
)(
std
::
ostream
&
))
->
LoggerOutputStream
&
;
auto
operator
<<
(
bool
msg
)
->
LoggerOutputStream
&
;
auto
operator
<<
(
int
msg
)
->
LoggerOutputStream
&
;
auto
operator
<<
(
uint64_t
msg
)
->
LoggerOutputStream
&
;
auto
operator
<<
(
int64_t
msg
)
->
LoggerOutputStream
&
;
...
...
This diff is collapsed.
Click to expand it.
src/caosdb/logging.cpp
+
12
−
0
View file @
507d4e3e
...
...
@@ -63,6 +63,18 @@ private:
LoggerOutputStream
::
LoggerOutputStream
(
std
::
string
channel
,
int
level
)
:
channel
(
std
::
move
(
channel
)),
level
(
level
)
{}
auto
LoggerOutputStream
::
operator
<<
(
std
::
ostream
&
(
*
f
)(
std
::
ostream
&
))
->
LoggerOutputStream
&
{
BOOST_LOG_CHANNEL_SEV
(
caosdb
::
logging
::
logger
::
get
(),
this
->
channel
,
this
->
level
)
<<
f
;
return
*
this
;
}
auto
LoggerOutputStream
::
operator
<<
(
bool
msg
)
->
LoggerOutputStream
&
{
BOOST_LOG_CHANNEL_SEV
(
caosdb
::
logging
::
logger
::
get
(),
this
->
channel
,
this
->
level
)
<<
msg
;
return
*
this
;
}
auto
LoggerOutputStream
::
operator
<<
(
std
::
streambuf
*
msg
)
->
LoggerOutputStream
&
{
BOOST_LOG_CHANNEL_SEV
(
caosdb
::
logging
::
logger
::
get
(),
channel
,
this
->
level
)
<<
msg
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment