New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible option to display myapp debug messages only. #290

Closed
gau1991 opened this Issue Jan 14, 2015 · 10 comments

Comments

Projects
None yet
3 participants
@gau1991

gau1991 commented Jan 14, 2015

Hello,
When I use --debug flag, with is also display cement.core debug messages, we dont want that Cement specific log messages.

./my.py --debug
2015-01-14 10:30:13,421 (DEBUG) cement.core.foundation : no cache handler defined, skipping.
2015-01-14 10:30:13,422 (DEBUG) cement.core.foundation : setting up myapp.log handler
2015-01-14 10:30:13,423 (DEBUG) cement.core.handler : merging config defaults from '<cement.ext.ext_logging.LoggingLogHandler object at 0x7fa1a139cf98>' into section 'log.logging'
2015-01-14 10:30:13,424 (DEBUG) myapp : logging initialized for 'myapp' using LoggingLogHandler
2015-01-14 10:30:13,425 (DEBUG) cement.core.foundation : setting up myapp.plugin handler
2015-01-14 10:30:13,427 (DEBUG) cement.ext.ext_plugin : plugin config dir /etc/myapp/plugins.d does not exist.
2015-01-14 10:30:13,428 (DEBUG) cement.ext.ext_plugin : plugin config dir /root/.myapp/plugins.d does not exist.
2015-01-14 10:30:13,429 (DEBUG) cement.core.foundation : setting up myapp.arg handler
2015-01-14 10:30:13,435 (DEBUG) cement.core.foundation : setting up myapp.output handler
2015-01-14 10:30:13,436 (DEBUG) cement.core.foundation : setting up application controllers
2015-01-14 10:30:13,437 (DEBUG) cement.core.hook : running hook 'post_setup' (<function add_handler_override_options at 0x7fa1a25ec6a8>) from cement.core.foundation
2015-01-14 10:30:13,438 (DEBUG) cement.core.hook : running hook 'post_argument_parsing' (<function handler_override at 0x7fa1a19e1ea0>) from cement.core.foundation
2015-01-14 10:30:13,439 (DEBUG) myapp : This is a debug message.
2015-01-14 10:30:13,440 (INFO) myapp : This is an info message.
2015-01-14 10:30:13,441 (WARNING) myapp : This is a warning message.

Is there any simple way to do that?

@derks

This comment has been minimized.

Show comment
Hide comment
@derks

derks Jan 15, 2015

Member

Never had that requested before. I will look into it now to see if it would be possible to hack into your app. What version of Cement are you running?

Member

derks commented Jan 15, 2015

Never had that requested before. I will look into it now to see if it would be possible to hack into your app. What version of Cement are you running?

@derks derks added the feature label Jan 15, 2015

@gau1991

This comment has been minimized.

Show comment
Hide comment
@gau1991

gau1991 Jan 15, 2015

I am currently using latest stable 2.4 version

gau1991 commented Jan 15, 2015

I am currently using latest stable 2.4 version

@derks

This comment has been minimized.

Show comment
Hide comment
@derks

derks Jan 15, 2015

Member

This is not guaranteed to work in future versions of Cement... however, the following allows you to disable Cement and Cement Extension (core or third-party) from displaying debug logs:

import sys

### this has to happen after you import sys, but before you import anything from Cement
if '--debug' in sys.argv:
    sys.argv.remove('--debug')
    TOGGLE_DEBUG = True
else:
    TOGGLE_DEBUG = False

from cement.core.foundation import CementApp


class MyApp(CementApp):
    class Meta:
        label = 'myapp'
        debug = TOGGLE_DEBUG

def main():
    app = MyApp()
    app.setup()
    app.run()
    app.close()

if __name__ == '__main__':
    main()

The app still logs (including debug):

$ python myapp.py --debug
2015-01-15 11:46:49,032 (DEBUG) myapp : logging initialized for 'myapp' using LoggingLogHandler
Member

derks commented Jan 15, 2015

This is not guaranteed to work in future versions of Cement... however, the following allows you to disable Cement and Cement Extension (core or third-party) from displaying debug logs:

import sys

### this has to happen after you import sys, but before you import anything from Cement
if '--debug' in sys.argv:
    sys.argv.remove('--debug')
    TOGGLE_DEBUG = True
else:
    TOGGLE_DEBUG = False

from cement.core.foundation import CementApp


class MyApp(CementApp):
    class Meta:
        label = 'myapp'
        debug = TOGGLE_DEBUG

def main():
    app = MyApp()
    app.setup()
    app.run()
    app.close()

if __name__ == '__main__':
    main()

The app still logs (including debug):

$ python myapp.py --debug
2015-01-15 11:46:49,032 (DEBUG) myapp : logging initialized for 'myapp' using LoggingLogHandler

gau1991 added a commit to EasyEngine/easyengine that referenced this issue Jan 16, 2015

@gau1991

This comment has been minimized.

Show comment
Hide comment
@gau1991

gau1991 Jan 16, 2015

@derks , Its wonderful, Nice hack 👍 , Thanks
Also if you add this option in next major release it will be wonderfull 😄

gau1991 commented Jan 16, 2015

@derks , Its wonderful, Nice hack 👍 , Thanks
Also if you add this option in next major release it will be wonderfull 😄

@derks

This comment has been minimized.

Show comment
Hide comment
@derks

derks Jan 17, 2015

Member

@gau1991 thanks! Glad that helped. I'm going to keep this open and see if we can't work it into Cement 2.6.

Member

derks commented Jan 17, 2015

@gau1991 thanks! Glad that helped. I'm going to keep this open and see if we can't work it into Cement 2.6.

@derks derks added this to the 2.5.2 Development milestone Jan 17, 2015

@derks derks added the stable/2.6.x label Jan 17, 2015

@derks derks self-assigned this Jan 17, 2015

@nhumrich

This comment has been minimized.

Show comment
Hide comment
@nhumrich

nhumrich Jan 21, 2015

I will +1 this request. I am currently using my own hack to do this:

def main():
    # Squash cement logging
    ######
    for d, k in iteritems(logging.Logger.manager.loggerDict):
        if d.startswith('cement') and isinstance(k, logging.Logger):
            k.setLevel('ERROR')
    #######

    app = MyApp()

nhumrich commented Jan 21, 2015

I will +1 this request. I am currently using my own hack to do this:

def main():
    # Squash cement logging
    ######
    for d, k in iteritems(logging.Logger.manager.loggerDict):
        if d.startswith('cement') and isinstance(k, logging.Logger):
            k.setLevel('ERROR')
    #######

    app = MyApp()
@derks

This comment has been minimized.

Show comment
Hide comment
@derks

derks May 5, 2015

Member

Wanted to follow up on this for some more feedback. I'm curious what the reasoning is in not wanting to see framework logging? Currently the framework, and any included extensions, only log to debug. I can see that there is a bit of noise in the initial startup of the app, however there are important details that are logged during runtime as well. For example, any time a hook is run we log what functions are being run within that hook to debug. Without framework logging, you wouldn't see that happening and therefore troubleshooting code issues could become very problematic without full visibility.

I'm definitely all for having at least the option to disable framework logging, but just looking for some feedback on it before making significant changes. The difficulty is that framework logging is setup before the app, therefore it doesn't rely on the applications configuration nor have access to it.

Potential avenues could be the use of an environment variable such as CEMENT_LOG where it would default to 1 (enabled, current state today) but could be disabled. One could then do something like the following in place of the current hacks above:

if not 'CEMENT_LOG' in os.environ.keys():
    os.environ['CEMENT_LOG'] = 0

That would allow the end user to explicitly enable cement logging if they needed to (troubleshooting a code issue, etc) but the app developer could default it to 0 (disabled) if they hate Cement taking over their debug space.

Thoughts?

Member

derks commented May 5, 2015

Wanted to follow up on this for some more feedback. I'm curious what the reasoning is in not wanting to see framework logging? Currently the framework, and any included extensions, only log to debug. I can see that there is a bit of noise in the initial startup of the app, however there are important details that are logged during runtime as well. For example, any time a hook is run we log what functions are being run within that hook to debug. Without framework logging, you wouldn't see that happening and therefore troubleshooting code issues could become very problematic without full visibility.

I'm definitely all for having at least the option to disable framework logging, but just looking for some feedback on it before making significant changes. The difficulty is that framework logging is setup before the app, therefore it doesn't rely on the applications configuration nor have access to it.

Potential avenues could be the use of an environment variable such as CEMENT_LOG where it would default to 1 (enabled, current state today) but could be disabled. One could then do something like the following in place of the current hacks above:

if not 'CEMENT_LOG' in os.environ.keys():
    os.environ['CEMENT_LOG'] = 0

That would allow the end user to explicitly enable cement logging if they needed to (troubleshooting a code issue, etc) but the app developer could default it to 0 (disabled) if they hate Cement taking over their debug space.

Thoughts?

@nhumrich

This comment has been minimized.

Show comment
Hide comment
@nhumrich

nhumrich May 5, 2015

I agree that having the logging on by default is good. The debug information can be very useful when initially writing my app/adding a hook/plugin. However, this information is useless and adds too much noise once I have the framework code all figured out.
Here is my usecase:
I use the --debug flag to log my own debug traces and stuff. I have gotten to the point where cement is never the problem. Users are aware of the --debug flag and often get confused by all the cement stuff. By "turning off" cement logging, it makes the debug log cleaner and more relevant for my app. I just dont need the cement logs at that point.
Of course, during development I sometimes turn cement debugging back on, if needs be.

The environment variable option could work.

nhumrich commented May 5, 2015

I agree that having the logging on by default is good. The debug information can be very useful when initially writing my app/adding a hook/plugin. However, this information is useless and adds too much noise once I have the framework code all figured out.
Here is my usecase:
I use the --debug flag to log my own debug traces and stuff. I have gotten to the point where cement is never the problem. Users are aware of the --debug flag and often get confused by all the cement stuff. By "turning off" cement logging, it makes the debug log cleaner and more relevant for my app. I just dont need the cement logs at that point.
Of course, during development I sometimes turn cement debugging back on, if needs be.

The environment variable option could work.

@derks

This comment has been minimized.

Show comment
Hide comment
@derks

derks May 5, 2015

Member

Thanks @nhumrich that's helpful! Glad to hear that "Cement is never the problem". ;)

Member

derks commented May 5, 2015

Thanks @nhumrich that's helpful! Glad to hear that "Cement is never the problem". ;)

derks added a commit that referenced this issue May 6, 2015

@derks

This comment has been minimized.

Show comment
Hide comment
@derks

derks May 6, 2015

Member

Pushed to cement/master:

from cement.core.foundation import CementApp

class MyApp(CementApp):
    class Meta:
        label = 'myapp'
        framework_logging = False

with MyApp() as app:
    app.run()
    app.log.info('My Info Test')
    app.log.debug('My Debug Test')

Default is CementApp.Meta.framework_logging = True (current state today). This option can be overridden by os.environ['CEMENT_FRAMEWORK_LOGGING'].

For example:

$ python myapp.py --debug
2015-05-05 20:29:02,275 (DEBUG) myapp : logging initialized for 'myapp' using LoggingLogHandler
2015-05-05 20:29:02,277 (INFO) myapp : My Info Test
2015-05-05 20:29:02,277 (DEBUG) myapp : My Debug Test

$ export CEMENT_FRAMEWORK_LOGGING=1

$ python myapp.py --debug
2015-05-05 20:29:34,848 (DEBUG) cement.core.foundation : laying cement for the 'myapp' application
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'pre_setup'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'post_setup'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'pre_run'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'post_run'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'pre_argument_parsing'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'post_argument_parsing'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'pre_close'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'post_close'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'signal'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'pre_render'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'post_render'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : registering hook 'add_handler_override_options' from cement.core.foundation into hooks['post_setup']
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : registering hook 'handler_override' from cement.core.foundation into hooks['post_argument_parsing']
2015-05-05 20:29:34,848 (DEBUG) cement.core.handler : defining handler type 'extension' (IExtension)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'log' (ILog)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'config' (IConfig)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'mail' (IMail)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'plugin' (IPlugin)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'output' (IOutput)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'argument' (IArgument)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'controller' (IController)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'cache' (ICache)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : registering handler '<class 'cement.core.extension.CementExtensionHandler'>' into handlers['extension']['cement']
2015-05-05 20:29:34,849 (DEBUG) cement.core.foundation : now setting up the 'myapp' application
2015-05-05 20:29:34,849 (DEBUG) cement.core.foundation : adding signal handler for signal 15
2015-05-05 20:29:34,849 (DEBUG) cement.core.foundation : adding signal handler for signal 2
2015-05-05 20:29:34,849 (DEBUG) cement.core.foundation : setting up myapp.extension handler
2015-05-05 20:29:34,849 (DEBUG) cement.core.extension : loading the 'cement.ext.ext_dummy' framework extension
2015-05-05 20:29:34,850 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_dummy.DummyOutputHandler'>' into handlers['output']['dummy']
2015-05-05 20:29:34,850 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_dummy.DummyMailHandler'>' into handlers['mail']['dummy']
2015-05-05 20:29:34,850 (DEBUG) cement.core.extension : loading the 'cement.ext.ext_smtp' framework extension
2015-05-05 20:29:34,863 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_smtp.SMTPMailHandler'>' into handlers['mail']['smtp']
2015-05-05 20:29:34,863 (DEBUG) cement.core.extension : loading the 'cement.ext.ext_plugin' framework extension
2015-05-05 20:29:34,864 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_plugin.CementPluginHandler'>' into handlers['plugin']['cement']
2015-05-05 20:29:34,864 (DEBUG) cement.core.extension : loading the 'cement.ext.ext_configparser' framework extension
2015-05-05 20:29:34,866 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_configparser.ConfigParserConfigHandler'>' into handlers['config']['configparser']
2015-05-05 20:29:34,866 (DEBUG) cement.core.extension : loading the 'cement.ext.ext_logging' framework extension
2015-05-05 20:29:34,866 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_logging.LoggingLogHandler'>' into handlers['log']['logging']
2015-05-05 20:29:34,866 (DEBUG) cement.core.extension : loading the 'cement.ext.ext_argparse' framework extension
2015-05-05 20:29:34,867 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_argparse.ArgParseArgumentHandler'>' into handlers['argument']['argparse']
2015-05-05 20:29:34,867 (DEBUG) cement.core.foundation : setting up myapp.config handler
2015-05-05 20:29:34,867 (DEBUG) cement.core.config : config file '/etc/myapp/myapp.conf' does not exist, skipping...
2015-05-05 20:29:34,867 (DEBUG) cement.core.config : config file '/Users/derks/.myapp.conf' exists, loading settings...
2015-05-05 20:29:34,867 (DEBUG) cement.core.config : config file '/Users/derks/.myapp/config' does not exist, skipping...
2015-05-05 20:29:34,868 (DEBUG) cement.core.foundation : setting up myapp.mail handler
2015-05-05 20:29:34,868 (DEBUG) cement.core.handler : merging config defaults from '<cement.ext.ext_dummy.DummyMailHandler object at 0x105120d90>' into section 'mail.dummy'
2015-05-05 20:29:34,868 (DEBUG) cement.core.foundation : no cache handler defined, skipping.
2015-05-05 20:29:34,868 (DEBUG) cement.core.foundation : setting up myapp.log handler
2015-05-05 20:29:34,868 (DEBUG) cement.core.handler : merging config defaults from '<cement.ext.ext_logging.LoggingLogHandler object at 0x105120d10>' into section 'log.logging'
2015-05-05 20:29:34,869 (DEBUG) myapp : logging initialized for 'myapp' using LoggingLogHandler
2015-05-05 20:29:34,869 (DEBUG) cement.core.foundation : setting up myapp.plugin handler
2015-05-05 20:29:34,869 (DEBUG) cement.ext.ext_plugin : plugin config dir /etc/myapp/plugins.d does not exist.
2015-05-05 20:29:34,869 (DEBUG) cement.ext.ext_plugin : plugin config dir /Users/derks/.myapp/plugins.d does not exist.
2015-05-05 20:29:34,869 (DEBUG) cement.core.foundation : setting up myapp.arg handler
2015-05-05 20:29:34,870 (DEBUG) cement.core.foundation : setting up myapp.output handler
2015-05-05 20:29:34,870 (DEBUG) cement.core.foundation : setting up application controllers
2015-05-05 20:29:34,870 (DEBUG) cement.core.hook : running hook 'post_setup' (<function add_handler_override_options at 0x104f49d70>) from cement.core.foundation
2015-05-05 20:29:34,870 (DEBUG) cement.core.hook : running hook 'post_argument_parsing' (<function handler_override at 0x104f49ed8>) from cement.core.foundation
2015-05-05 20:29:34,870 (INFO) myapp : My Info Test
2015-05-05 20:29:34,870 (DEBUG) myapp : My Debug Test
2015-05-05 20:29:34,870 (DEBUG) cement.core.foundation : closing the application

Or vice-versa ... if the default is set for Cement logging enabled... it can be disabled by:

$ export CEMENT_FRAMEWORK_LOGGING=0

Will be available in stable/2.6.0.

Member

derks commented May 6, 2015

Pushed to cement/master:

from cement.core.foundation import CementApp

class MyApp(CementApp):
    class Meta:
        label = 'myapp'
        framework_logging = False

with MyApp() as app:
    app.run()
    app.log.info('My Info Test')
    app.log.debug('My Debug Test')

Default is CementApp.Meta.framework_logging = True (current state today). This option can be overridden by os.environ['CEMENT_FRAMEWORK_LOGGING'].

For example:

$ python myapp.py --debug
2015-05-05 20:29:02,275 (DEBUG) myapp : logging initialized for 'myapp' using LoggingLogHandler
2015-05-05 20:29:02,277 (INFO) myapp : My Info Test
2015-05-05 20:29:02,277 (DEBUG) myapp : My Debug Test

$ export CEMENT_FRAMEWORK_LOGGING=1

$ python myapp.py --debug
2015-05-05 20:29:34,848 (DEBUG) cement.core.foundation : laying cement for the 'myapp' application
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'pre_setup'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'post_setup'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'pre_run'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'post_run'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'pre_argument_parsing'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'post_argument_parsing'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'pre_close'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'post_close'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'signal'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'pre_render'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : defining hook 'post_render'
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : registering hook 'add_handler_override_options' from cement.core.foundation into hooks['post_setup']
2015-05-05 20:29:34,848 (DEBUG) cement.core.hook : registering hook 'handler_override' from cement.core.foundation into hooks['post_argument_parsing']
2015-05-05 20:29:34,848 (DEBUG) cement.core.handler : defining handler type 'extension' (IExtension)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'log' (ILog)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'config' (IConfig)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'mail' (IMail)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'plugin' (IPlugin)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'output' (IOutput)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'argument' (IArgument)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'controller' (IController)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : defining handler type 'cache' (ICache)
2015-05-05 20:29:34,849 (DEBUG) cement.core.handler : registering handler '<class 'cement.core.extension.CementExtensionHandler'>' into handlers['extension']['cement']
2015-05-05 20:29:34,849 (DEBUG) cement.core.foundation : now setting up the 'myapp' application
2015-05-05 20:29:34,849 (DEBUG) cement.core.foundation : adding signal handler for signal 15
2015-05-05 20:29:34,849 (DEBUG) cement.core.foundation : adding signal handler for signal 2
2015-05-05 20:29:34,849 (DEBUG) cement.core.foundation : setting up myapp.extension handler
2015-05-05 20:29:34,849 (DEBUG) cement.core.extension : loading the 'cement.ext.ext_dummy' framework extension
2015-05-05 20:29:34,850 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_dummy.DummyOutputHandler'>' into handlers['output']['dummy']
2015-05-05 20:29:34,850 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_dummy.DummyMailHandler'>' into handlers['mail']['dummy']
2015-05-05 20:29:34,850 (DEBUG) cement.core.extension : loading the 'cement.ext.ext_smtp' framework extension
2015-05-05 20:29:34,863 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_smtp.SMTPMailHandler'>' into handlers['mail']['smtp']
2015-05-05 20:29:34,863 (DEBUG) cement.core.extension : loading the 'cement.ext.ext_plugin' framework extension
2015-05-05 20:29:34,864 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_plugin.CementPluginHandler'>' into handlers['plugin']['cement']
2015-05-05 20:29:34,864 (DEBUG) cement.core.extension : loading the 'cement.ext.ext_configparser' framework extension
2015-05-05 20:29:34,866 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_configparser.ConfigParserConfigHandler'>' into handlers['config']['configparser']
2015-05-05 20:29:34,866 (DEBUG) cement.core.extension : loading the 'cement.ext.ext_logging' framework extension
2015-05-05 20:29:34,866 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_logging.LoggingLogHandler'>' into handlers['log']['logging']
2015-05-05 20:29:34,866 (DEBUG) cement.core.extension : loading the 'cement.ext.ext_argparse' framework extension
2015-05-05 20:29:34,867 (DEBUG) cement.core.handler : registering handler '<class 'cement.ext.ext_argparse.ArgParseArgumentHandler'>' into handlers['argument']['argparse']
2015-05-05 20:29:34,867 (DEBUG) cement.core.foundation : setting up myapp.config handler
2015-05-05 20:29:34,867 (DEBUG) cement.core.config : config file '/etc/myapp/myapp.conf' does not exist, skipping...
2015-05-05 20:29:34,867 (DEBUG) cement.core.config : config file '/Users/derks/.myapp.conf' exists, loading settings...
2015-05-05 20:29:34,867 (DEBUG) cement.core.config : config file '/Users/derks/.myapp/config' does not exist, skipping...
2015-05-05 20:29:34,868 (DEBUG) cement.core.foundation : setting up myapp.mail handler
2015-05-05 20:29:34,868 (DEBUG) cement.core.handler : merging config defaults from '<cement.ext.ext_dummy.DummyMailHandler object at 0x105120d90>' into section 'mail.dummy'
2015-05-05 20:29:34,868 (DEBUG) cement.core.foundation : no cache handler defined, skipping.
2015-05-05 20:29:34,868 (DEBUG) cement.core.foundation : setting up myapp.log handler
2015-05-05 20:29:34,868 (DEBUG) cement.core.handler : merging config defaults from '<cement.ext.ext_logging.LoggingLogHandler object at 0x105120d10>' into section 'log.logging'
2015-05-05 20:29:34,869 (DEBUG) myapp : logging initialized for 'myapp' using LoggingLogHandler
2015-05-05 20:29:34,869 (DEBUG) cement.core.foundation : setting up myapp.plugin handler
2015-05-05 20:29:34,869 (DEBUG) cement.ext.ext_plugin : plugin config dir /etc/myapp/plugins.d does not exist.
2015-05-05 20:29:34,869 (DEBUG) cement.ext.ext_plugin : plugin config dir /Users/derks/.myapp/plugins.d does not exist.
2015-05-05 20:29:34,869 (DEBUG) cement.core.foundation : setting up myapp.arg handler
2015-05-05 20:29:34,870 (DEBUG) cement.core.foundation : setting up myapp.output handler
2015-05-05 20:29:34,870 (DEBUG) cement.core.foundation : setting up application controllers
2015-05-05 20:29:34,870 (DEBUG) cement.core.hook : running hook 'post_setup' (<function add_handler_override_options at 0x104f49d70>) from cement.core.foundation
2015-05-05 20:29:34,870 (DEBUG) cement.core.hook : running hook 'post_argument_parsing' (<function handler_override at 0x104f49ed8>) from cement.core.foundation
2015-05-05 20:29:34,870 (INFO) myapp : My Info Test
2015-05-05 20:29:34,870 (DEBUG) myapp : My Debug Test
2015-05-05 20:29:34,870 (DEBUG) cement.core.foundation : closing the application

Or vice-versa ... if the default is set for Cement logging enabled... it can be disabled by:

$ export CEMENT_FRAMEWORK_LOGGING=0

Will be available in stable/2.6.0.

@derks derks closed this May 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment