-
Notifications
You must be signed in to change notification settings - Fork 9
Various bugfixes #2
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,17 +85,19 @@ def start(): | |
| botsglobal.logger = botsinit.initenginelogging(process_name) | ||
| atexit.register(logging.shutdown) | ||
| except Exception as msg: | ||
| print('Error initialising logging:' + msg) | ||
| botslib.sendbotserrorreport('[Bots severe error] Bots is not running anymore','Bots does not run because logging is not possible.\nOften a rights problem.\n') | ||
| sys.exit(1) | ||
| else: | ||
| if botsglobal.ini.get('settings','log_file_number','') != 'daily': | ||
| if botsglobal.ini.get('settings','log_when',None) != 'daily': | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure I understand this. there is no 'log_when'. if new, what does it do?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought you had added log_when? It is there in botsinit so I changed engine to use it also.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I originally made this change years ago and probably posted to the mailing list, but only used log_file_number at that time. In my installations I keep daily logs and do daily reporting on those in botsengine postcleanup.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs to be added in bots.ini but comment out by default #log_file_number: number of rotating log files. Value: number. Default: 10
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could also use a setting in bots.ini to explicitly state the default; it will not affect operation of this setting. #for one merged log per day, set log_when = daily. Default: Each run uses it's own log file |
||
| for key,value in botslib.botsinfo(): #log info about environement, versions, etc | ||
| botsglobal.logger.info('%(key)s: "%(value)s".',{'key':key,'value':value}) | ||
|
|
||
| #**************connect to database********************************** | ||
| try: | ||
| botsinit.connect() | ||
| except Exception as msg: | ||
| print('Error connecting to database:' + msg) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not needed, is via logger
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added these for quicker debugging while testing, it's good to see errors on the console
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not needed, is via logger
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added these for quicker debugging while testing, it's good to see errors on the console |
||
| botsglobal.logger.exception('Could not connect to database. Database settings are in bots/config/settings.py. Error: "%(msg)s".',{'msg':msg}) | ||
| sys.exit(1) | ||
| else: | ||
|
|
@@ -196,6 +198,7 @@ def start(): | |
|
|
||
| cleanup.cleanup(do_cleanup_parameter,userscript,scriptname) | ||
| except Exception as msg: | ||
| print('Severe error:' + msg) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not needed, is via logger
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added these for quicker debugging while testing, it's good to see errors on the console |
||
| botsglobal.logger.exception('Severe error in bots system:\n%(msg)s',{'msg':unicode(msg)}) #of course this 'should' not happen. | ||
| sys.exit(1) | ||
| else: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed, is via logger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this error is during log init, so never gets logged!
(I had this error a long time ago and took me a while to track down what caused it... but can't remember what it was now. Maybe permissions on the log folder)