Mercurial > projects > mde
diff mde/file/paths.d @ 151:e785e98d3b78
Updated for compatibility with tango 0.99.8.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Sat, 04 Apr 2009 17:32:18 +0200 |
parents | 9f035cd139c6 |
children |
line wrap: on
line diff
--- a/mde/file/paths.d Sat Apr 04 11:59:27 2009 +0200 +++ b/mde/file/paths.d Sat Apr 04 17:32:18 2009 +0200 @@ -51,12 +51,10 @@ } else version (Windows) import tango.sys.win32.SpecialPath; -debug { - import tango.util.log.Log : Log, Logger; - private Logger logger; - static this() { - logger = Log.getLogger ("mde.file.paths"); - } +import tango.util.log.Log : Log, Logger; +private Logger logger; +static this() { + logger = Log.getLogger ("mde.file.paths"); } /** Order to read files in. @@ -197,8 +195,7 @@ paths[pathsLen++] = fp.toString~'/'; return true; } catch (Exception e) { - // No logging avaiable yet: Use Stdout/Cout - Cout ("Creating path "~path~" failed:" ~ e.msg).newline; + logger.error ("Creating path {} failed:" ~ e.msg, path); } } return false; @@ -209,7 +206,7 @@ for (size_t i = 0; i < pathsLen; ++i) Cout ("\n\t" ~ paths[i]); } else - Cout ("[none]"); + Cout (" [none]"); } // Use a static array to store all possible paths with separate length counters. @@ -310,12 +307,11 @@ confDir.tryPath (userPath.toString ~ "/conf", true); if (extraConfPath) confDir.tryPath (extraConfPath); - if (!dataDir.pathsLen) throw new mdeException ("Fatal: no data path found!"); - if (!confDir.pathsLen) throw new mdeException ("Fatal: no conf path found!"); + if (dataDir.pathsLen==0) throw new mdeException ("Fatal: no data path found!"); + if (confDir.pathsLen==0) throw new mdeException ("Fatal: no conf path found!"); for (int i = dataDir.pathsLen - 1; i >= 0; --i) { FilePath font = FilePath (dataDir.paths[i] ~ "fonts"); - Cout ("considering: ")(font.toString).newline; if (font.exists && font.isFolder) fontPaths[iFP++] = font; }