Starting March 27, 2025, we recommend using android-latest-release instead of aosp-main to build and contribute to AOSP. For more information, see Changes to AOSP.
         
       
     
  
  
  
  
  
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
  
  
    
    
  
  
BaseStreamLogger
  public
  
  
  abstract
  class
  BaseStreamLogger
  
  
  
  
    extends BaseLeveledLogOutput
  
  
  
  
  
  
  
  
  
  
    
      | 
          Known indirect subclasses
          
  
  
    
  
  
    
      
        | HistoryLogger | TF History Logger, special log that contains only some specific events. |  | 
  
    
  A ILeveledLogOutput that directs log messages to an output stream and to stdout.
Summary
| Protected methods | 
|---|
  
  
  
    | 
        
        
        
        
        
        void | 
      writeToLog(String message)
      Writes a message to the output stream.
        
    
 | 
  
Fields
    mOutputStream
    
      
  
      
  
    
protected OS extends OutputStream mOutputStream
    
    
    
  
    
 
Public constructors
    BaseStreamLogger
    
public BaseStreamLogger ()
    
    
    
  
 
Public methods
    closeLog
    
public void closeLog ()
    
    
    
  
 
    getLogLevelDisplay
    
public Log.LogLevel getLogLevelDisplay ()
    
    
    
  
    
 
    printAndPromptLog
    
public void printAndPromptLog (Log.LogLevel logLevel, 
                String tag, 
                String message)
    
    
    
  
    
    | Parameters | 
|---|
      
        | logLevel | Log.LogLevel | 
      
        | tag | String | 
      
        | message | String | 
    
 
    printLog
    
public void printLog (Log.LogLevel logLevel, 
                String tag, 
                String message)
    
    
    
  
    
    | Parameters | 
|---|
      
        | logLevel | Log.LogLevel | 
      
        | tag | String | 
      
        | message | String | 
    
 
    setLogLevel
    
public void setLogLevel (Log.LogLevel logLevel)
    
    
    
  
    
    | Parameters | 
|---|
      
        | logLevel | Log.LogLevel | 
    
 
    setLogLevelDisplay
    
public void setLogLevelDisplay (Log.LogLevel logLevel)
    
    
    
  For compatibility
    
    | Parameters | 
|---|
      
        | logLevel | Log.LogLevel | 
    
 
    setLogLevelDisplay
    
public void setLogLevelDisplay (Log.LogLevel logLevel)
    
    
    
  Sets the minimum LogLevel to display on stdout.
    
    | Parameters | 
|---|
      
        | logLevel | Log.LogLevel | 
    
 
Protected methods
    writeToLog
    
protected void writeToLog (String message)
    
    
    
  Writes a message to the output stream.
    
    | Parameters | 
|---|
      
        | message | String: the entry to write to log | 
    
      
      | Throws | 
|---|
        
          |  | if an I/O error occurs | 
      
  
 
 
 
  
  
 
  
    
    
      
    
    
  
       
    
    
  
  
  Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
  Last updated 2024-08-13 UTC.
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-13 UTC."],[],[]]