~mrol-dev/mrol/trunk

« back to all changes in this revision

Viewing changes to mrol_mapping/log.py

  • Committer: Vikas Dhiman
  • Date: 2012-11-16 19:59:46 UTC
  • Revision ID: vikasdhi@buffalo.edu-20121116195946-fwfdqevt3h3eqoyg
Manually added julians changes after merge failed. "Added function to save point cloud in the .ply format"; "Got speed_test working again after API changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import logging
2
 
logging.basicConfig(filename='/tmp/mrol_logger.log')
3
 
class PrintLogger(object):
4
 
    def debug(self, msg):
5
 
        print(msg)
6
 
    def info(self, msg):
7
 
        print(msg)
8
 
    def setLevel(self, level):
9
 
        pass
10
2
def getLogger(name):
11
3
    logger = logging.getLogger(name)
12
4
    # create console handler with a higher log level
16
8
    formatter = logging.Formatter('%(name)s - %(message)s')
17
9
    ch.setFormatter(formatter)
18
10
    logger.addHandler(ch)
19
 
    #return logger
20
 
    return PrintLogger()
 
11
    return logger