Commit graph

45 commits

Author SHA1 Message Date
mathieui
7b01c62e07
Change the API of Config.get_by_tabname
Make the "default" parameter optional and thus move it to the end of
the command with the other optional parameters.

And change all the calls.
2014-10-20 21:20:43 +02:00
mathieui
1ce485c6fa Fix #2354 (logs are badly colored with xhtml history)
- now it should work properly
- add a COLOR_LOG_MSG theming option, used both for local and remote
  history
2014-04-07 01:25:30 +02:00
mathieui
e000466ab8 Do not instantiate the message logger at module level
.
2014-04-06 17:26:33 +02:00
mathieui
ca0950db07 Remove unused imports
(thanks eijebong)
2014-04-04 00:24:16 +02:00
mathieui
02d9fd9ad4 Fix #2462 (wrong timezone in the logs)
Now everything in the logs is in UTC time, and is converted when read

(also, actually return the logs after loading them instead of not doing
anything)
2014-04-01 00:03:29 +02:00
mathieui
8d4202501d Use RawConfigParser.get{int,bool,float} whenever possible
config.get('option', 'value').lower() == 'value' is just ugly and
stupid, especially for bool.

One if in basetabs:556 was also missing a comparison, leading to True
whenever the option was set.
2014-03-24 23:25:06 +01:00
Mathieu Pasquet
7e4a565517 Fix a traceback when opening an empty log file 2014-01-29 16:44:43 +01:00
Florent Le Coz
099d1d1c2c TIL splitlines() 2013-09-06 17:35:50 +02:00
Florent Le Coz
4b662ffa67 Much more efficient and clean way to get the last n messages from history 2013-09-06 14:24:05 +02:00
mathieui
6f2cca61d4 Remove debug 2013-08-13 07:39:12 +02:00
mathieui
2fe84a1188 Fix a crash for python < 3.3 2013-08-06 22:23:47 +02:00
mathieui
3e7353758e Fix the folder creation for roster changes 2013-08-06 19:07:44 +02:00
mathieui
e5e63d4725 Prevent messages with typ=0 from being logged
(new typ value)
2013-08-04 14:50:57 +02:00
mathieui
7538093a07 Do not load logs if use_logs is false 2013-08-04 11:21:28 +02:00
mathieui
135ef1b364 Fix a traceback on get_logs 2013-08-04 11:06:05 +02:00
mathieui
31c2e23c4c Logs errors by default, in a dedicated file
- log_errors option, true by default
- errors go in log_dir/errors.log (so $XDG_DATA_HOME/errors.log
    by default)

This should help a lot for debugging, and provide a way for people
to easily give debug traces without useless or personal infos.
2013-08-03 19:27:25 +02:00
mathieui
6c046fe161 Parse the new log format to display it. (ref #2311)
Archiving old logs is recommended before running this update,
just in case.
2013-06-22 00:17:55 +02:00
mathieui
d269617788 Revert 9eaffe1369 because of 3.1 compat 2013-06-19 12:16:28 +02:00
mathieui
9d5fddf5ba Use the new format in the roster log too (ref #2311)
(and add the pep events and invites to it)
2013-06-09 12:56:51 +02:00
mathieui
71b6404b04 Adopt the mcabber log format (Fix #2311) 2013-06-09 03:47:16 +02:00
mathieui
9eaffe1369 Fix the os.makedirs calls so that they don’t traceback for nothing 2013-06-09 03:45:10 +02:00
mathieui
e5f219d43e Do not attempt to log things when use_log = false 2013-04-06 11:45:34 +02:00
mathieui
91b960b797 Handle I/O errors better
- Do not crash because of low disk space
- Notify the user whenever it happens
- A few functions now return a boolean instead of nothing
- Config.silent_set is Config.set_and_save without toggle and returning
  strings. It is used whenever we don’t need set_and_save
- Config.set_and_save now returns a tuple (that can be passed directly
  to core.information())

TODO: display the precise error to the user (instead of “unable to…”)
2013-04-05 23:57:53 +02:00
mathieui
e8fae6f24c Fix #2275, ref #2229
- Refactor the message handlers to be more readable
- Add a group_corrections tab-specific option (#2229)
- Fix issues with /correct in private tabs and conversation tabs
2013-03-31 16:33:10 +02:00
mathieui
cb900858a0 Fix the per-tab options on logs 2012-12-16 13:42:22 +01:00
mathieui
344e8c8d6c fix a traceback when we accidentally seek() in the middle of a char 2012-12-15 23:34:28 +01:00
mathieui
423bae05b0 Really make the use_log a tab-specific option.
and do not read the whole log file for the last lines.
2012-12-15 23:23:12 +01:00
mathieui
08ca9bd5c5 Sort the configurations options by name in the documentation
(instead of chaos)
2012-12-15 22:57:57 +01:00
mathieui
9f7a16141a Fix #2172 (select which rooms are logged) 2012-12-15 20:29:37 +01:00
mathieui
6781f67e80 Preload history into discussion windows (à la mcabber)
- New option load_log defaulting to 200 to indicate the number of lines
  to be loaded
- It’s still very raw, and the format of the message does not match the
  format of the normal room history, for example
- Works in the Private chat, MUC, and Conversation tabs

Thanks to labedz <github@labedz.org> for the original code
2012-11-11 16:01:53 +01:00
mathieui
941acdb612 Fixes #2350 (reloading static resources on SIGHUP) 2012-04-02 18:30:06 +02:00
mathieui
75f7d71080 Use os.path.expanduser to interpret '~' for _dir config options 2011-11-16 09:46:09 +01:00
mathieui
c3c67b5e0a Code cleanup (unused import, variables, undefined names, etc…) 2011-11-06 21:10:09 +01:00
Florent Le Coz
96794a4e49 Change license to zlib (MIT sucks :() 2011-09-11 17:10:05 +02:00
Florent Le Coz
d41634d4ea Change license to MIT 2011-09-06 02:45:53 +02:00
mathieui
afab9e050f Fixes bug #2183 2011-06-18 18:31:57 +02:00
mathieui
1c9fc655dd Fixes #2174 2011-05-27 23:36:52 +02:00
Florent Le Coz
cc74576c9f Avoid crash when write to log file fails 2011-02-21 21:00:23 +01:00
Florent Le Coz
ce1fc18e10 Log messages from normal and private conversations as well 2011-01-12 18:34:04 +01:00
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13
ab85a3dc21 fix the log of MUC messages in files 2011-01-02 16:58:40 +00:00
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13
d712d2e1c9 update copyright date 2011-01-01 13:27:07 +00:00
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13
f4d4a205f1 a few renamings, and some other stuff 2010-11-15 11:59:09 +00:00
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13
d4e3e51c1f update e-mail address and README 2010-10-04 01:45:16 +00:00
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13
17eb99eea7 python 3 only. Fixes all EncodingError bugs :)))) 2010-09-03 18:01:43 +00:00
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13
e84b23d1ad Switch to Sleekxmpp. fixed #1768 2010-08-31 23:11:02 +00:00
Renamed from src/logging.py (Browse further)