commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/5dbfdeb3295f/ Changeset: 5dbfdeb3295f User: jmchilton Date: 2013-12-02 22:15:16 Summary: Delay problems with fluent logger dependencies until fluent logger used. Affected #: 1 file diff -r ef33472f0aa296e55fd811357e09366f9cee5467 -r 5dbfdeb3295f23eea643f74c100d3549c6ddafb7 lib/galaxy/util/log/fluent_log.py --- a/lib/galaxy/util/log/fluent_log.py +++ b/lib/galaxy/util/log/fluent_log.py @@ -5,15 +5,23 @@ import time import threading -import galaxy.eggs -galaxy.eggs.require( "fluent-logger" ) -galaxy.eggs.require( "msgpack_python" ) +try: + import galaxy.eggs + galaxy.eggs.require( "fluent-logger" ) + galaxy.eggs.require( "msgpack_python" ) +except Exception: + pass -from fluent.sender import FluentSender +try: + from fluent.sender import FluentSender +except ImportError: + FluentSender = None class FluentTraceLogger( object ): def __init__( self, name, host='localhost', port=24224 ): + if FluentSender is None: + raise Exception("Attempted to use FluentTraceLogger with not Fluent dependency available.") self.lock = threading.Lock() self.thread_local = threading.local() self.name = name @@ -36,4 +44,4 @@ if hasattr( self.thread_local, 'context' ): kwargs.update( self.thread_local.context ) self.lock.release() - self.sender.emit_with_time( label, int(time.time()), kwargs ) \ No newline at end of file + self.sender.emit_with_time( label, int(time.time()), kwargs ) https://bitbucket.org/galaxy/galaxy-central/commits/34d18fc63a7c/ Changeset: 34d18fc63a7c User: jmchilton Date: 2013-12-03 17:39:21 Summary: Merged in jmchilton/galaxy-central-fork-1 (pull request #270) Delay potential problems with fluent logger dependencies until fluent logger used. Affected #: 1 file diff -r 5667c340ef5de4254e1c591bf1e20c10a078b2c1 -r 34d18fc63a7c9232dc23184094fef3f022e12036 lib/galaxy/util/log/fluent_log.py --- a/lib/galaxy/util/log/fluent_log.py +++ b/lib/galaxy/util/log/fluent_log.py @@ -5,15 +5,23 @@ import time import threading -import galaxy.eggs -galaxy.eggs.require( "fluent-logger" ) -galaxy.eggs.require( "msgpack_python" ) +try: + import galaxy.eggs + galaxy.eggs.require( "fluent-logger" ) + galaxy.eggs.require( "msgpack_python" ) +except Exception: + pass -from fluent.sender import FluentSender +try: + from fluent.sender import FluentSender +except ImportError: + FluentSender = None class FluentTraceLogger( object ): def __init__( self, name, host='localhost', port=24224 ): + if FluentSender is None: + raise Exception("Attempted to use FluentTraceLogger with not Fluent dependency available.") self.lock = threading.Lock() self.thread_local = threading.local() self.name = name @@ -36,4 +44,4 @@ if hasattr( self.thread_local, 'context' ): kwargs.update( self.thread_local.context ) self.lock.release() - self.sender.emit_with_time( label, int(time.time()), kwargs ) \ No newline at end of file + self.sender.emit_with_time( label, int(time.time()), kwargs ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org