[PEAK] peak logs
darryl
developer at csrules.dyndns.org
Fri Jan 2 15:40:26 EST 2004
>
> Then, the "child" component doesn't have the parent you think it
> does. Use 'config.iterParents()' to walk over the parents and you'll
> probably find that the component doing the offering isn't in the list.
Ok test.ini file:
----------------------------------------
[peak.logs]
* = logs.LogStream(stream=importString('sys.stderr'),level=logs.DEBUG)
bots.jabber =
logs.LogStream(stream=importString('sys.stderr'),levelName = "DEBUG")
[peak.running]
app = importString('testCase:Runner')
----------------------------------------
testCase.py:
-------------------------------------------------------------
from peak.api import *
class MyBrokenClass(binding.Component):
log = binding.Obtain(PropertyName('app.log'))
def main(self):
print self.log
print self.log.level
self.log.debug('test')
main = binding.Make(main, uponAssembly=True)
class Runner(running.commands.EventDriven):
log = binding.Obtain('logger:bots.jabber', offerAs = ['app.log'])
atest = binding.Make(MyBrokenClass, uponAssembly=True)
-----------------------------------------------------------------
Now we run it:
-----------------------------------------------------------------
darryl at hydra jabberbot $ peak runIni test.ini
<peak.running.logs.LogStream object at 0x83d8324>
30
-----------------------------------------------------------------
What am i doing wrong ?
-darryl
More information about the PEAK
mailing list