File: OsgAndroidNotifyHandler.cpp

package info (click to toggle)
openscenegraph 3.2.3%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 32,820 kB
  • ctags: 34,610
  • sloc: cpp: 370,040; ansic: 9,071; java: 1,020; yacc: 548; objc: 288; makefile: 285; xml: 155; lex: 151
file content (38 lines) | stat: -rw-r--r-- 1,104 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * OsgAndroidNotifyHandler.cpp
 *
 *  Created on: 31/05/2011
 *      Author: Jorge Izquierdo Ciges
 */

#include "OsgAndroidNotifyHandler.hpp"
#include <iostream>

void OsgAndroidNotifyHandler::setTag(std::string tag){
    _tag = tag;
}
void OsgAndroidNotifyHandler::notify(osg::NotifySeverity severity, const char *message){

    switch ( severity ) {
        case osg::DEBUG_FP:
            __android_log_write(ANDROID_LOG_VERBOSE,_tag.c_str(),message);
          break;
        case osg::DEBUG_INFO:
            __android_log_write(ANDROID_LOG_DEBUG,_tag.c_str(),message);
          break;
        case osg::NOTICE:
        case osg::INFO:
            __android_log_write(ANDROID_LOG_INFO,_tag.c_str(),message);
          break;
        case osg::WARN:
            __android_log_write(ANDROID_LOG_WARN,_tag.c_str(),message);
          break;
        case osg::FATAL:
        case osg::ALWAYS:
            __android_log_write(ANDROID_LOG_ERROR,_tag.c_str(),message);
          break;
        default:
            __android_log_write(ANDROID_LOG_DEBUG,_tag.c_str(),message);
          break;
    }
}