Skip to content

Commit

Permalink
logging: logging format from R-Commons
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Rodriguez committed Apr 2, 2019
1 parent 4a67646 commit 0a8c024
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
3 changes: 3 additions & 0 deletions reana_workflow_engine_cwl/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@
BROKER_URL))

MOUNT_CVMFS = os.getenv('REANA_MOUNT_CVMFS', 'false')

LOGGING_MODULE = 'reana-workflow-engine-cwl'
"""REANA Workflow Engine CWL logging module."""
4 changes: 2 additions & 2 deletions reana_workflow_engine_cwl/cwl_reana.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
from reana_commons.api_client import JobControllerAPIClient as rjc_api_client
from reana_commons.config import REANA_WORKFLOW_UMASK

from reana_workflow_engine_cwl.config import MOUNT_CVMFS
from reana_workflow_engine_cwl.config import LOGGING_MODULE, MOUNT_CVMFS
from reana_workflow_engine_cwl.pipeline import Pipeline
from reana_workflow_engine_cwl.poll import PollThread

log = logging.getLogger("cwl-backend")
log = logging.getLogger(LOGGING_MODULE)


class ReanaPipeline(Pipeline):
Expand Down
9 changes: 5 additions & 4 deletions reana_workflow_engine_cwl/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
import pkg_resources
from cwltool.context import LoadingContext

from reana_commons.config import REANA_WORKFLOW_UMASK
from reana_commons.config import (REANA_LOG_FORMAT, REANA_LOG_LEVEL,
REANA_WORKFLOW_UMASK)
from reana_workflow_engine_cwl.__init__ import __version__
from reana_workflow_engine_cwl.config import SHARED_VOLUME_PATH
from reana_workflow_engine_cwl.config import LOGGING_MODULE, SHARED_VOLUME_PATH
from reana_workflow_engine_cwl.context import REANARuntimeContext
from reana_workflow_engine_cwl.cwl_reana import ReanaPipeline
from reana_workflow_engine_cwl.database import SQLiteHandler

log = logging.getLogger("reana-workflow-engine-cwl")
log.setLevel(logging.INFO)
logging.basicConfig(level=REANA_LOG_LEVEL, format=REANA_LOG_FORMAT)
log = logging.getLogger(LOGGING_MODULE)
console = logging.StreamHandler()
log.addHandler(console)

Expand Down
4 changes: 3 additions & 1 deletion reana_workflow_engine_cwl/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
from cwltool.mutation import MutationManager
from cwltool.process import cleanIntermediate, relocateOutputs

log = logging.getLogger("tes-backend")
from reana_workflow_engine_cwl.config import LOGGING_MODULE

log = logging.getLogger(LOGGING_MODULE)


class Pipeline(object):
Expand Down
4 changes: 3 additions & 1 deletion reana_workflow_engine_cwl/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
import click
from reana_commons.publisher import WorkflowStatusPublisher
from reana_workflow_engine_cwl import main
from reana_workflow_engine_cwl.config import LOGGING_MODULE

log = logging.getLogger(__name__)

log = logging.getLogger(LOGGING_MODULE)


def load_json(ctx, param, value):
Expand Down

0 comments on commit 0a8c024

Please sign in to comment.