Skip to content
This repository was archived by the owner on Jun 11, 2020. It is now read-only.

Commit 4e97ccd

Browse files
committed
Updates documentation, fixes bug with SLF4j style formatting when mixed with Parseltongue
1 parent 1717347 commit 4e97ccd

11 files changed

Lines changed: 176 additions & 163 deletions

File tree

License.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016 JavaEden
3+
Copyright (c) 2018 JavaEden
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

src/main/java/com/caseyjbrooks/clog/parseltongue/Parseltongue.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,11 @@ private ParseltonguePair<Boolean, Object> param() {
447447
int index = b.getIntValue();
448448

449449
if(index > 0 && (index - 1) < params.size()) {
450+
autoParamCounter++;
450451
return new ParseltonguePair<>(true, params.get(index - 1));
451452
}
452453
else {
454+
autoParamCounter++;
453455
return new ParseltonguePair<>(true, null);
454456
}
455457
}
@@ -615,7 +617,7 @@ private ParseltonguePair<Boolean, NullObject> nullLit() {
615617
return new ParseltonguePair<>(false, null);
616618
}
617619

618-
//result ::= ATSIGN NUMBER
620+
//autoParam ::=
619621
private ParseltonguePair<Boolean, Object> autoParam() {
620622
Token a = ts.get();
621623

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
3+
version: '1.6.3'
4+
5+
---
6+
7+
- Updates Orchid documentation
8+
- fixes bug with SLF4j style formatting when mixed with Parseltongue
Lines changed: 79 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,121 @@
11
---
2+
23
title: Android Clog
4+
35
---
46

5-
<section class="bs-docs-section">
6-
<h1 id="overview" class="page-header">Using Clog with Android</h1>
7+
# Using Clog with Android
8+
{ #overview .page-header }
9+
10+
> Clog is a replacement of the standard Android Log. Featuring multiple logging profiles, removal of annoying tags, and
11+
> the powerful Parselmouth formatting language, you'll wonder how you ever got by without it.
712
8-
<blockquote>
9-
Clog is a drop-in replacement of the standard Android Log. Featuing multiple logging profiles and the powerful Parselmouth formatting language, you'll wonder how you ever got by without it.
10-
</blockquote>
13+
### Features
1114

12-
<h3 id="features">Features</h3>
15+
- All features of the base Clog library
16+
- Android-specific logging profiles for both development and production
1317

14-
<ul>
15-
<li>All features of the base Clog library</li>
16-
<li>Android-specific logging profiles for both development and production</li>
17-
</ul>
18+
19+
# Get It
20+
{ #download .page-header }
1821

19-
</section>
22+
### Include In Your Project
2023

21-
<section class="bs-docs-section">
22-
<h1 id="download" class="page-header">Get It</h1>
24+
Android Clog can be added to your project from Jitpack through Gradle.
2325

24-
<h3 id="download-include">Include In Your Project</h3>
25-
<p>
26-
Android Clog can be added to your project from Jitpack through Gradle.
27-
</p>
26+
Add this to your project-level build.gradle:
2827

29-
<p>
30-
Add this to your project-level build.gradle:
31-
</p>
32-
<pre>
28+
```groovy
3329
allprojects {
3430
repositories {
3531
...
3632
maven { url "https://jitpack.io" }
3733
}
38-
}</pre>
34+
}
35+
```
36+
37+
Add this to your module's dependencies:
3938

40-
<p>
41-
Add this to your module's dependencies:
42-
</p>
43-
<pre>
39+
```groovy
4440
dependencies {
4541
...
46-
compile('com.github.cjbrooks12:Android-Clog:v{{site.version}}@aar') {
47-
transitive = true;
48-
}
49-
}</pre>
42+
api 'com.github.cjbrooks12:Android-Clog:v{{site.version}}'
43+
}
44+
```
45+
5046

51-
<h3 id="download-github">Github</h3>
52-
<p>
53-
Full source can be viewed on Github. Feel free to send me a PR.
54-
</p>
55-
<div>
56-
<a href="https://github.com/cjbrooks12/Android-Clog">Github Repo</a>
57-
</div>
47+
### Github
5848

59-
<h3 id="download-jitpack">Jitpack</h3>
60-
<p>
61-
Download the most recent commits, or see instructions for installing with Maven, at Jitpack.
62-
</p>
63-
<div>
64-
<a href="https://jitpack.io/#cjbrooks12/Android-Clog"><img src="https://camo.githubusercontent.com/86295ad9ade648308e2328e7b2aba032fed9cc0c/68747470733a2f2f6a69747061636b2e696f2f762f636a62726f6f6b7331322f416e64726f69642d436c6f672e737667" alt="" data-canonical-src="https://jitpack.io/v/cjbrooks12/Android-Clog.svg" style="max-width:100%;"></a>
65-
</div>
49+
Full source can be viewed on [Github](https://github.com/cjbrooks12/Android-Clog). Feel free to send me a PR.
6650

67-
<h3 id="download-javadoc">View Javadoc</h3>
68-
<p>
69-
View javadoc, hosted by Jitpack.
70-
</p>
71-
<div>
72-
<a href="https://jitpack.io/com/github/cjbrooks12/Clog/v{{site.version}}/javadoc/"><img src="https://camo.githubusercontent.com/e987e48872f10d633fc044d7e20e7b82f99df591/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f636a62726f6f6b7331322f436c6f672e7376673f6d61784167653d32353932303030266c6162656c3d6a617661646f63" alt="JitPack Javadoc" data-canonical-src="https://img.shields.io/github/tag/cjbrooks12/Clog.svg?maxAge=2592000&amp;label=javadoc" style="max-width:100%;"></a>
73-
</div>
74-
</section>
51+
### Jitpack
7552

76-
<section class="bs-docs-section">
77-
<h1 id="use" class="page-header">Use in your apps</h1>
53+
Download the most recent commits, or see instructions for installing with Maven, at Jitpack.
54+
55+
[![](https://jitpack.io/v/JavaEden/Clog.svg)](https://jitpack.io/#JavaEden/Clog)
56+
57+
### Javadoc
7858

79-
<h3 id="use-implementation">Clog implementation</h3>
59+
View javadoc, hosted by Jitpack.
8060

81-
<p>See <a href="https://github.com/cjbrooks12/Clog">https://github.com/cjbrooks12/Clog</a> for information on Clog.</p>
61+
[![](https://jitpack.io/v/JavaEden/Clog.svg)](https://jitpack.io/com/github/cjbrooks12/Clog/v{{site.version}}/javadoc/)
8262

83-
<p>Android Clog provides simple Android Log implementations for Clog. The mapping between Clog levels and Android Clog levels is one-to-one, as the Clog API was designed to directly replace Log:</p>
63+
# Use In Your Apps
64+
{ #download .page-header }
8465

85-
<p><code>Clog.d(...) --&gt; Log.d(...)</code></p>
66+
### Clog implementation
8667

87-
<p><code>Clog.e(...) --&gt; Log.e(...)</code></p>
68+
See [{{site.baseUrl}}]({{site.baseUrl}}) for information on Clog.
8869

89-
<p><code>Clog.i(...) --&gt; Log.i(...)</code></p>
70+
Android Clog provides simple Android Log implementations for Clog. The mapping between Clog levels and Android Clog
71+
levels is one-to-one, as the Clog API was designed to replace Log, but be more flexible and not require tags with the
72+
logging calls.
9073

91-
<p><code>Clog.v(...) --&gt; Log.v(...)</code></p>
74+
`Clog.v(...) ->> Log.v(...)`
9275

93-
<p><code>Clog.w(...) --&gt; Log.w(...)</code></p>
76+
`Clog.d(...) ->> Log.d(...)`
9477

95-
<p><code>Clog.wtf(...) --&gt; Log.wtf(...)</code></p>
78+
`Clog.i(...) ->> Log.i(...)`
9679

97-
<p>In addition, Clog tags work exactly like Android Log tags, like so:</p>
80+
`Clog.w(...) ->> Log.w(...)`
9881

99-
<pre>
100-
d(String tag, String message) {
101-
Log.d(tag, message);
102-
}</pre>
82+
`Clog.e(...) ->> Log.e(...)`
10383

104-
<p>Getting Android Clog integrated into your project is easy. Add the following to your Activity's <code>onCreate()</code>:</p>
84+
`Clog.wtf(...) ->> Log.wtf(...)`
10585

106-
<pre>
86+
In addition, Clog gets rid of the annoying Android Log tags. By default, the Tag passed to the Android logger is the
87+
simple classname of the calling class:
88+
89+
```
90+
Clog.d(String message) ->> Log.d(callerClassName, message)
91+
```
92+
93+
If, for some reason, you need to set the Tag to something other than the caller class's name, you can push a Tag into
94+
Clog before logging:
95+
96+
```
97+
Clog.pushTag(customTag);
98+
Clog.d(message); ->> Log.d(customTag, message)
99+
```
100+
101+
Just make sure to pop it back off when you're done, otherwise other places will be logged with that tag as well.
102+
103+
```
104+
Clog.popTag();
105+
```
106+
107+
Getting Android Clog integrated into your project is easy. Add the following to your Activity's or Application's
108+
`onCreate()` method:
109+
110+
```java
107111
if(BuildConfig.DEBUG) {
108112
Clog.setCurrentProfile("dev", AndroidClog.getDevelopmentClog());
109113
}
110114
else {
111115
Clog.setCurrentProfile("prod", AndroidClog.getProductionClog());
112-
}</pre>
113-
114-
<p>In development, all logs will be directed to the standard Log implementations shown above, but in production, all logs will be discarded. You can replace the production log profile with implementations that write to file or send to Crashlytics if you need that instead.</p>
115-
116+
}
117+
```
116118

117-
</section>
119+
In development, all logs will be directed to the standard Log implementations shown above, but in production, all logs
120+
will be discarded. You can replace the production log profile with implementations that write to file or send to
121+
Crashlytics if you need that instead.

0 commit comments

Comments
 (0)