10 Commits (2b0f65a9ee9b74002c8dea5a9f0e10b40f0516de)

Author SHA1 Message Date
Manish 2b0f65a9ee Fixes "Logs are not line buffered" #868 issue in sugar repo
Reason why it was working in python 2 is because this file is
added only when switched to python 3. Compare
[logger.py](https://github.com/sugarlabs/sugar-toolkit-gtk3/blob/v0.95.2/src/sugar3/logger.py)
file in sugar3 directory of v0.95.2 with
[sugar directory](https://github.com/sugarlabs/sugar-toolkit-gtk3/tree/v0.95.1/src/sugar)
of v0.95.1
4 years ago
Pro-Panda aa8a5e70c4 Port from Python 2 to six
Signed-off-by: James Cameron <quozl@laptop.org>
5 years ago
James Cameron dd512c9c29 Fix common typo, occured should be occurred 7 years ago
James Cameron 280c74cd9e allow start on full disk
When disk is full, Sugar will not start, because the backup log
directory cannot be created.

X session logs in tmpfs show this exception:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/site-packages/jarabe/main.py", line 20, in <module>
    logger.cleanup()
  File "/usr/lib/python2.7/site-packages/sugar3/logger.py", line 113, in cleanup
    os.mkdir(backup_dir)
OSError: [Errno 28] No space left on device: '/home/user/.sugar/default/logs/1448258018'

Fix is to ignore the exception.

We've been here before!  Was previously fixed in 2010:

	https://github.com/sugarlabs/sugar/commit/4cde481
	https://bugs.sugarlabs.org/ticket/1720
	http://dev.laptop.org/ticket/9623

But new regression introduced in 2012 during reorganisation of
code by Daniel Narvaez; the exception was no longer handled:

	https://github.com/sugarlabs/sugar/commit/0e45f9d
	https://github.com/sugarlabs/sugar/commit/19db9c5

Reported-by: Nathan Riddle <nathanr333@charter.net>
Tested-by: James Cameron <quozl@laptop.org>
9 years ago
akskumarnot 81b388c554 Use proper formatting syntax, fixes #2170 11 years ago
Daniel Narvaez cf392735a0 Ensure logs path exists when initializing logs
Otherwise, for example, if we start datastore alone
like we do in the tests, we try to create logs without
the directory and traceback.
11 years ago
Daniel Narvaez fd831931ad Remove duplicated code
And deprecate duplicated function.
11 years ago
William Orr c736ffefcd pep8'd sugar3 11 years ago
Daniel Narvaez 2bbeba2446 Logger: add cleanup function
Factored out from the sugar shell code

Acked-by: Simon Schampijer <simon@laptop.org>
11 years ago
Daniel Drake e2c07af748 Import sugar-base into sugar-toolkit
Probably needs cleaning up a bit. And we use pygtk-codegen, ugh...

This is the commit id when we imported sugar-base:
b9406e5c9c9df5404c5b0d995178b5edb4d93628

Signed-off-by: Daniel Drake <dsd@laptop.org>
[squashed two patches into one]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago