-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: generate readme from synth.py (#96)
docs: generate readme from synth.py
- Loading branch information
Showing
3 changed files
with
151 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
custom_content: | | ||
### Usage | ||
Add the appender to your [Logback configuration](https://logback.qos.ch/manual/configuration.html) `logback.xml`. | ||
See [Logback filters](https://logback.qos.ch/manual/filters.html#thresholdFilter) for information on filtering log output and | ||
[encoders](https://logback.qos.ch/manual/encoders.html) for information on formatting. | ||
```xml | ||
<configuration> | ||
<appender name="CLOUD" class="com.google.cloud.logging.logback.LoggingAppender"> | ||
<!-- Optional : filter logs at or above a level --> | ||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | ||
<level>INFO</level> | ||
</filter> | ||
<log>application.log</log> <!-- Optional : default java.log --> | ||
<!-- Optional : will use the default credentials of the environment if this property is not set --> | ||
<credentialsFile>/path/to/credentials.json</credentialsFile> | ||
<enhancer>com.example.enhancers.TestLoggingEnhancer</enhancer> <!-- Optional --> | ||
<enhancer>com.example.enhancers.AnotherEnhancer</enhancer> <!-- Optional --> | ||
<flushLevel>WARN</flushLevel> <!-- Optional : default ERROR --> | ||
</appender> | ||
<root level="info"> | ||
<appender-ref ref="CLOUD" /> | ||
</root> | ||
</configuration> | ||
``` | ||
In your code : | ||
```java | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
public class TestLogger { | ||
private final Logger logger = LoggerFactory.getLogger(TestLogger.class); | ||
public void log(String name) { | ||
logger.info("This is a test"); | ||
} | ||
public static void main(String[] args) { | ||
TestLogger testLogger = new TestLogger(); | ||
testLogger.log("test"); | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,4 @@ | |
|
||
AUTOSYNTH_MULTIPLE_COMMITS = True | ||
|
||
java.common_templates(excludes=[ | ||
'README.md', | ||
]) | ||
java.common_templates() |